Skip to content

Commit b362920

Browse files
mamenobu
authored andcommitted
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.
1 parent e9e8e3f commit b362920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/io/console/console.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ typedef struct termios conmode;
2323
static int
2424
setattr(int fd, conmode *t)
2525
{
26-
while (tcsetattr(fd, TCSAFLUSH, t)) {
26+
while (tcsetattr(fd, TCSANOW, t)) {
2727
if (errno != EINTR) return 0;
2828
}
2929
return 1;

0 commit comments

Comments
 (0)