Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: don't flush tty on switch to raw mode
Browse files Browse the repository at this point in the history
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 nodejs/node-v0.x-archive#2744.
  • Loading branch information
bnoordhuis committed Feb 13, 2012
1 parent bc8b990 commit b8649fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unix/tty.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit b8649fd

Please sign in to comment.