commit 9e7f1e78806716bc893701b50b29cd791489015d
parent 874a6329096155b854a387dcc1a5d73f738cdff0
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 24 Oct 2014 22:12:47 +0000
restore terminal attribute before reopen with initial input just to be sure
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/sob.c b/sob.c
@@ -908,6 +908,9 @@ initialinput(void)
buf[r] = '\0';
handleinput(buf, r);
}
+ /* restore terminal attributes. */
+ ttystate.c_lflag = ttysave.c_lflag;
+ tcsetattr(STDIN_FILENO, TCSANOW, &ttystate);
/* close and reattach to stdin */
close(STDIN_FILENO);
if((fd = open("/dev/tty", O_RDONLY | O_NONBLOCK)) == -1) {