Noticed that my updated patch left the terminal in a bad state on exit. Attached patched fixes that.
-- see shy jo
diff --git a/ttyrec.c b/ttyrec.c index 3392f70..03626ce 100644 --- a/ttyrec.c +++ b/ttyrec.c @@ -193,8 +193,9 @@ doinput() #ifdef HAVE_openpty (void) close(slave); #endif - while ((cc = read(0, ibuf, BUFSIZ)) > 0) + while ((cc = read(0, ibuf, BUFSIZ)) > 0) { (void) write(master, ibuf, cc); + } done(); } @@ -209,14 +210,10 @@ finish() union wait status; #endif /* !SVR4 */ register int pid; - register int die = 0; while ((pid = wait3((int *)&status, WNOHANG, 0)) > 0) if (pid == child) - die = 1; - - if (die) - done(); + close(0); } struct linebuf { @@ -371,7 +368,7 @@ done() (void) fclose(fscript); (void) close(master); } else { - (void) tcsetattr(0, TCSAFLUSH, &tt); + (void) tcsetattr(1, TCSAFLUSH, &tt); } exit(0); }
signature.asc
Description: Digital signature