4.2BSD Script drops characters

Chuck Privitera crp at ccivax.UUCP
Sat Nov 10 05:55:47 AEST 1984


Index:	ucb/script.c 4.2BSD/(2.9BSD?)

Description:
	When running script on a terminal with a small input
	buffer, (like a vt100), the terminal drops characters.
	However, the "capture" file has all of the data in it.
Repeat-By:
	I noticed it by simply doing a diff -c5. Try cat'ing a
	long file, or holding down the no-scroll button for a while.
	The vt100 displays "error" characters interspersed with
	the output, and the output is obviously not complete.
	(i.e. words may be joined together, etc.). We have installed
	the pty speedup posted by uthub!thomson, which I suspect
	caused this problem (by feeding data to the control terminal
	faster). Thus, you may not see this problem very frequently.
	(You should see it by the second method above nevertheless).
Fix:
	Anyways, the fix is to put the control terminal into CBREAK
	mode instead of RAW mode, so that when the terminal (or the
	user) sends an XOFF (DC3/023) character, the host can stop
	sending data until it receives an XON (DC1/021). Since the
	vt100 sends XOFF/XON like crazy, (and displays the error
	character on buffer overflow) those of you with vt100s will
	see this behaviour more often. Not that it's needed but,
	here is a context diff of the change:


rcsdiff -c5 script.c
RCS file: RCS/script.c,v
retrieving revision 1.1
diff -c5 -r1.1 script.c
*** /tmp/,RCSt1006462   Fri Nov  9 14:31:11 1984
--- script.c    Wed Oct 31 15:38:57 1984
***************
*** 154,164
  fixtty()
  {
        struct sgttyb sbuf;
  
        sbuf = b;
!       sbuf.sg_flags |= RAW;
        sbuf.sg_flags &= ~ECHO;
        ioctl(0, TIOCSETP, (char *)&sbuf);
  }
  
  fail()

--- 154,164 -----
  fixtty()
  {
        struct sgttyb sbuf;
  
        sbuf = b;
!       sbuf.sg_flags |= CBREAK;
        sbuf.sg_flags &= ~ECHO;
        ioctl(0, TIOCSETP, (char *)&sbuf);
  }
  
  fail()



More information about the Comp.bugs.2bsd mailing list