Subject: kern/613: TIOCSETAW on telnet ptys doesn't seem to flush first
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: None <tsm@cs.brown.edu>
List: netbsd-bugs
Date: 12/05/1994 19:20:08
>Number:         613
>Category:       kern
>Synopsis:       TIOCSETAW on telnet ptys doesn't seem to flush first
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec  5 19:20:05 1994
>Originator:     Timothy Miller
>Organization:
"	Little, if any"
>Release:        I believe this is -current as of near the end of November
>Environment:
I think the next line about sums it up
System: NetBSD cis-ts3-slip4.cis.brown.edu 1.0A NetBSD 1.0A (HAYWIRE) #6: Fri Dec 2 21:40:11 EST 1994 tim@haywire.pvd.ri.us:/usr/src/sys/arch/i386/compile/HAYWIRE i386

>Description:
running a shell which has one termios setting for running programs and one for
reading input (such as zsh, which is what I'm running), the setting of the
terminal attributes, which is supposed to flush first (it does
tcsetattr(fd, TCSADRAIN, ...) which (in libc) does an ioctl(fd, TIOCSETAW, ..))
apparently does not, at least for telnet sessions (see how to repeat)
>How-To-Repeat:
I'm running slip over a 14.4 modem. Telnetting in to my system from across the
modem, most commands with multiline output have the last line or so with the
wrong formatting (in particular, the newline just does a cr, not a crnl).
Simply doing ls of my home directory does this (most of the time). Doing
something like "ls; sleep 1" appears to prevent the problem. Here's some sample
output:

tim@cis-ts3-slip4 /usr/src 0 -> ls
bin             games           lib             sbin            usr.bin
                                                                       distrib gnu              libexec         share           usr.sbin
                                                        etc             includeregress          sys
tim@cis-ts3-slip4 /usr/src 0 -> ls;sleep 1
bin             games           lib             sbin            usr.bin
distrib         gnu             libexec         share           usr.sbin
etc             include         regress         sys

>Fix:
>Audit-Trail:
>Unformatted: