From b39d5da97426c6f65e2b39b307ce19d774d93ddd Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sat, 14 Dec 2019 19:15:02 +0900 Subject: [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 --- ext/io/console/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/io/console/console.c b/ext/io/console/console.c index ec70bdf9df..9bd825aaa0 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -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; -- cgit v1.2.3