stty hupcl ixon ixoff
I'm seeing stty, not a typewritter
messages on hpux (despite an interactive terminal check?), and am guessing that these are due to the stty lines in my .kshrc file:
case $- in
*i* )
stty hupcl ixon ixoff
stty erase '^?' kill '^U' intr '^C' eof '^D' susp '^Z'
;;
esac
Two questions:
1) I know why the erase line is there, since backspace doesn't work without it. These .kshrc lines I've inherited, but don't know what they do.
Anybody know the point of the hupcl ixon ixoff lines? The stty man page isn't particularly enlightening:
hupcl (-hupcl) Hang up (do not hang up) modem connection on
last close.
ixon (-ixon) Enable (disable) START/STOP output control.
开发者_如何学运维 Output is stopped by sending an ASCII DC3 and
started by sending an ASCII DC1.
ixoff (-ixoff) Request that the system send (not send)
START/STOP characters when the input queue is
nearly empty/full.
2) Is there a different way to check for interactive terminals. I had tty -s ; if [ $? ] before but that also appears to be noisy on hpux.
ixon
and ixoff
are used to insist that Ctrl-s and Ctrl-q be interpreted as control flow (scroll lock) signals. They're the default on most systems, but if you have a fast connection and/or don't anticipate a volume of output that your terminal can't handle, you're fine to turn them off.
I typically use stty -ixon -ixoff
so I can reclaim the Ctrl-s and Ctrl-q key bindings for more modern purposes (e.g. "save" and "quit").
For more details: https://unix.stackexchange.com/questions/12107/how-to-unfreeze-after-accidentally-pressing-ctrl-s-in-a-terminal#12146
\1.
As you've inherited your .kshrc, there might have been a reason that at one time you system needed those extra hupcl, ixon, ixoff
parameters. They might be obsolete now, but they might be something that is HP centric. OR it could be that some application works better with them included. Maybe an ol' timer will know.
Anybody know the point of the hupcl ixon ixoff lines
To me those descriptions are pretty self evident, but then I have had to deal with such issues way----yyyy back, and read the Orielly termcap & terminfo to sort it out.
You can look at man ascii
to see DC3 and DC1 in their context, or google searches might get you something interesting.
Now a-days, I would expect that unless you have special needs, that these aren't really helping you. Do you have special HP hardware or special terminfo applications. If not, try commenting that line out.
\2. Test for interactive
I like your case $- in *i* ...
that should be good enough.
else
if tty -s > /dev/null 2>&1 ; then ...
might be help
OR the cannonical
if [[ -t 0 ]]; then
I hope this helps.
精彩评论