Skip to content

Commit

Permalink
apply the patch in antirez#75
Browse files Browse the repository at this point in the history
  • Loading branch information
zcourts committed Mar 16, 2016
1 parent 027dbce commit ec80f9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions linenoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static int enableRawMode(int fd) {
raw.c_cc[VMIN] = 1; raw.c_cc[VTIME] = 0; /* 1 byte, no timer */

/* put terminal in raw mode after flushing */
if (tcsetattr(fd,TCSAFLUSH,&raw) < 0) goto fatal;
if (tcsetattr(fd,TCSADRAIN,&raw) < 0) goto fatal;
rawmode = 1;
return 0;

Expand All @@ -251,7 +251,7 @@ static int enableRawMode(int fd) {

static void disableRawMode(int fd) {
/* Don't even check the return value as it's too late. */
if (rawmode && tcsetattr(fd,TCSAFLUSH,&orig_termios) != -1)
if (rawmode && tcsetattr(fd,TCSADRAIN,&orig_termios) != -1)
rawmode = 0;
}

Expand Down

0 comments on commit ec80f9b

Please sign in to comment.