From e8c7a57b4fafb16a4cbf535c8e07066b20ed9551 Mon Sep 17 00:00:00 2001 From: Andrew McGill Date: Tue, 29 Jul 2008 23:56:05 +0200 Subject: [PATCH] script: don't flush input when starting script script currently flushed the input buffer when starting up. This undocumented behaviour prevents typeahead when starting up (e.g. as part of .profile). Rather retain queued input. Don't discard queued output either. Signed-off-by: Andrew McGill --- misc-utils/script.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc-utils/script.c b/misc-utils/script.c index 45a9c3e7..12ea43a8 100644 --- a/misc-utils/script.c +++ b/misc-utils/script.c @@ -408,7 +408,7 @@ fixtty() { rtt = tt; cfmakeraw(&rtt); rtt.c_lflag &= ~ECHO; - (void) tcsetattr(0, TCSAFLUSH, &rtt); + (void) tcsetattr(0, TCSANOW, &rtt); } void @@ -432,7 +432,7 @@ done() { (void) fclose(fscript); (void) close(master); } else { - (void) tcsetattr(0, TCSAFLUSH, &tt); + (void) tcsetattr(0, TCSADRAIN, &tt); if (!qflg) printf(_("Script done, file is %s\n"), fname); } @@ -493,7 +493,7 @@ getslave() { perror(line); fail(); } - (void) tcsetattr(slave, TCSAFLUSH, &tt); + (void) tcsetattr(slave, TCSANOW, &tt); (void) ioctl(slave, TIOCSWINSZ, (char *)&win); #endif (void) setsid(); -- 2.39.5