unix: don't flush tty on switch to raw mode
Drain, don't flush the tty when switching from cooked to raw mode. Prevents buffered keystrokes from getting lost. Switching back to cooked mode still flushes. Fixes joyent/node#2744.
This commit is contained in:
parent
bc8b99097a
commit
b8649fdf00
@ -76,8 +76,8 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) {
|
||||
raw.c_cc[VMIN] = 1;
|
||||
raw.c_cc[VTIME] = 0;
|
||||
|
||||
/* Put terminal in raw mode after flushing */
|
||||
if (tcsetattr(fd, TCSAFLUSH, &raw)) {
|
||||
/* Put terminal in raw mode after draining */
|
||||
if (tcsetattr(fd, TCSADRAIN, &raw)) {
|
||||
goto fatal;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user