Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ccivax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!rochester!ritcv!ccivax!crp From: crp@ccivax.UUCP (Chuck Privitera) Newsgroups: net.bugs.4bsd,net.bugs.2bsd Subject: Re: 4.2BSD Script drops characters Message-ID: <222@ccivax.UUCP> Date: Wed, 14-Nov-84 09:23:23 EST Article-I.D.: ccivax.222 Posted: Wed Nov 14 09:23:23 1984 Date-Received: Sat, 17-Nov-84 04:29:26 EST References: <219@ccivax.UUCP> <3197@ucbvax.ARPA> Distribution: net Organization: CCI Telephony Systems Group, Rochester NY Lines: 81 Description: In article <3197@ucbvax.ARPA> Jeff Anton points out: > .... > In cbreak mode interupt chars from the terminal will be > caught and delivered to the script program which is > not set up to handle them properly. An oversight on my part, sorry for the inconvenience. I just noticed this yesterday when I used script to post some bug reports. Repeat-by: Apply the cbreak fix article <219@ccivax.UUCP> then run script. When the interupt or quit character is typed script will exit leaving the terminal in cbreak mode and -echo. (typing the suspend character will suspend script, probably NOT what you wanted) Fix: Turn off all special characters except start/stop. rcsdiff -c3 -r1.2 script.c RCS file: RCS/script.c,v retrieving revision 1.2 diff -c3 -r1.2 script.c *** /tmp/,RCSt1002637 Wed Nov 14 09:10:11 1984 --- script.c Wed Nov 14 09:09:05 1984 *************** *** 151,156 fail(); } fixtty() { struct sgttyb sbuf; --- 151,159 ----- fail(); } + struct tchars ntc = { -1, -1, -1, -1, -1, -1 }; + struct ltchars nlc = { -1, -1, -1, -1, -1, -1 }; + fixtty() { struct sgttyb sbuf; *************** *** 159,164 sbuf.sg_flags |= CBREAK; sbuf.sg_flags &= ~ECHO; ioctl(0, TIOCSETP, (char *)&sbuf); } fail() --- 162,171 ----- sbuf.sg_flags |= CBREAK; sbuf.sg_flags &= ~ECHO; ioctl(0, TIOCSETP, (char *)&sbuf); + ntc.t_startc = tc.t_startc; + ntc.t_stopc = tc.t_stopc; + ioctl(0, TIOCSETC, (char *)&ntc); + ioctl(0, TIOCSLTC, (char *)&nlc); } fail() *************** *** 172,177 { ioctl(0, TIOCSETP, (char *)&b); printf("Script done, file is %s\n", fname); exit(0); } --- 179,186 ----- { ioctl(0, TIOCSETP, (char *)&b); + ioctl(0, TIOCSETC, (char *)&tc); + ioctl(0, TIOCSLTC, (char *)&lc); printf("Script done, file is %s\n", fname); exit(0); }