I've got an 'annoyance' with the way the STTY settings are remembered
between sessions (on a modem, attached to /dev/tty1A), even after the line
has been dropped.
I've had a quick look through the man page for stty and it doesn't mention
anything about remembering stty settings, so I'm just trying to figure out
why.
I'm assuming it's because the line isn't dropped between dial-in sessions,
that any STTY settings that are set on the line are remembered. Am I very
far afield on that, or looking at the right thing?
If that is the case, is there any neat way to clear the stty settings after
a modem line drops carrier?
Currently I work in an office with a number of people all using their own
emulation programs. I personally use XTerm's (SCO X-Vision on PC) at 132x74
cols/rows. To get some of the management programs we use (no source
available unfortunately) to work properly, I have to issue:
export LINES=74 COLUMNS=132 TERM=xterm;stty tab3 rows 74 cols 132
Fine. Unfortunately, the 'rows 74 cols 132' doesn't un-set it's self with
the shell after an exit, but stay associted with the TTY. This of course
causes grief to people who come after me with their 80x25 (if I forget to
issue 'stty rows 25 cols 80' before dropping the line).
Anyway.. Any help would be appreciated..
NOTE: This issue doesn't affect psuedo tty's, just the physical tty's (ie.
anything with a 'getty' attached to it).
bkx
This was a bug with some releases of OpenServer and fixed in others.
However, my crystal ball and my Quantum Uncertainty Device are coming up
cloudy with regard to this behavior on No Specific Release of No
Specific Operating System.
>Bela<
*cringe* I can't beleive I did that. Confirmed behaviour under
OSR5.0.[456].
All with latest RS applied.
bkx
It doesn't have anything to do with the line not being dropped. It's because
the terminal window size parameters (rows, cols, xpixels, ypixels) are
relatively new, and noone ever added code to the serial driver to initialize
them when a device is opened. I will see to it.
>If that is the case, is there any neat way to clear the stty settings after
>a modem line drops carrier?
You could put this in /etc/profile, so it's run when a user logs in:
stty rows 0 cols 0 xpixels 0 ypixels 0
John
--
John DuBois spc...@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/
> "Bela Lubkin" <be...@caldera.com> wrote in message
> news:2002050212...@mammoth.ca.caldera.com...
> > Stuart J. Browne wrote:
> >
> > > I've got an 'annoyance' with the way the STTY settings are remembered
> > > between sessions (on a modem, attached to /dev/tty1A), even after the line
> > > has been dropped.
> > > ... Unfortunately, the 'rows 74 cols 132' doesn't un-set it's self
> > This was a bug with some releases of OpenServer and fixed in others.
> > However, my crystal ball and my Quantum Uncertainty Device are coming up
> > cloudy with regard to this behavior on No Specific Release of No
> > Specific Operating System.
>
> *cringe* I can't beleive I did that. Confirmed behaviour under
> OSR5.0.[456].
>
> All with latest RS applied.
Well, John points out that this _is_ a bug with current releases... it
was fixed for the pty driver in rs506a (maybe 5.0.6), but not
generically. The code that resets those values should be in the generic
tty driver, not in each hardware driver.
For the moment, the workaround
of putting `stty rows 0 columns 0` in /etc/profile & /etc/cshrc may
suffice. Or may not -- I suspect that will have a negative effect on
network protocols such as telnet, which pass screen dimensions. You
would need to figure out how to zero the settings only for non-network
logins. Something like:
case `tty` in
/dev/ttyp[0-9]*) :;; # pty driver gets it right; don't override telnetd
"not a tty") :;; # avoid stty error message if not a tty
*) stty rows 0 columns 0;;
esac
>Bela<
Possibly - though most apps still use the LINES and COLUMNS environment
variables.
>You would need to figure out how to zero the settings only for non-network
>logins. Something like:
>
> case `tty` in
> /dev/ttyp[0-9]*) :;; # pty driver gets it right; don't override telnetd
> "not a tty") :;; # avoid stty error message if not a tty
> *) stty rows 0 columns 0;;
> esac
Or modify /etc/inittab to use /usr/lib/uucp/uugetty instead of /etc/getty,
and modify /usr/lib/uucp/uugetty to be something like:
UNTESTED! vvv
#!/bin/ksh
# Get non-modem-control (lower-case) version of port
set -A args -- "$@"
shift $#-2
typeset -l tty=$1
stty rows 0 cols 0 xpixels 0 ypixels 0 < "$tty"
exec /etc/getty "${args[@]}"
UNTESTED! ^^^
Thanks John & Bela. Will give these a shot.
bkx