Subject: Re: xon/xoff, dtr/dsr, cts/rts... help!
To: Frederick Bruckman <fredb@immanent.net>
From: Johnny Billquist <bqt@update.uu.se>
List: current-users
Date: 11/01/2002 16:54:33
On Fri, 1 Nov 2002, Frederick Bruckman wrote:

> On Fri, 1 Nov 2002, Peter Seebach wrote:
> 
> > In message <Pine.NEB.4.44.0211010819281.2062-100000@elation.immanent.net>, Fred
> > erick Bruckman writes:
> > >To address the last point, first, and work up: (4) I don't think
> > >that's the case. I can ssh from a VT420. Listing a large file is
> > >painfully slow, as the VT dutifully sends the xoff every 128
> > >characters, but the display doesn't get corrupted, or log me out,
> > >or anything like that.

Note that a VT420 don't send an xoff every 128 characters. It sends an
xoff if the input buffer reaches 128 characters full.

> > Hmm.
> >
> > I can reproduce it; I ssh to another host, and then "stty -a -f /dev/tty00"
> > shows -ixon -ixoff again.  Weird.
> 
> (On othe original host, of course.) Hey, it does that for me, too. It
> doesn't seem to have any consequences, though.

And it makes sense. ssh pretends to be transparent. That means that
xon/xoff should be passed on over the link. The remote end should handle
it, if software flow control is required.
It's a problem, because at the same time, you want to have this as close
to the terminal as possible, since you have a short time between sending
the xoff until it is reacted upon, during which you will get additional
characters. Because of this, terminals using software flow control must be
able to handle a few more characters coming in after the xoff have been
sent. On "modern" terminals you can select at which point the xoff is
sent, so that you better can handle slow reaction to the xoff.

So, it's all as could be expected. How to "solve" this so that no
characters are lost is another issue.
If possible, set the limit before sending xoff as low as possible. Run
through screen, or some other middleware, which buffers, and retain the
software flow control on the local side (if screen does this?). Or use
something other than ssh. I think rlogin allows xon/xoff to be processed
locally, and the rest passes over (or if it was telnet).

Perhaps ssh should have an option for letting the local system handle
software flow control.

	Johnny

Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol