mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/io-console] Use TCSANOW to prevent from discarding the input buffer
TCSAFLUSH discards the buffer read before the mode change, which makes IRB ignore the buffer input immediately after invoked. TCSANOW preserves the buffer. https://github.com/ruby/io-console/commit/b362920182
This commit is contained in:
parent
81eb2d16ef
commit
b39d5da974
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ typedef struct termios conmode;
|
|||
static int
|
||||
setattr(int fd, conmode *t)
|
||||
{
|
||||
while (tcsetattr(fd, TCSAFLUSH, t)) {
|
||||
while (tcsetattr(fd, TCSANOW, t)) {
|
||||
if (errno != EINTR) return 0;
|
||||
}
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue