Skip to content

Commit

Permalink
Fixing Bug antirez#75 on antirez/linenoise
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonophoto authored Nov 15, 2016
1 parent a2df650 commit 7ed4e90
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 @@ -359,7 +359,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 @@ -370,7 +370,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 7ed4e90

Please sign in to comment.