[KLUG Members] Re: [Speakers] I think I'm Terminal

Dirk Bartley members@kalamazoolinux.org
22 Sep 2001 16:41:20 -0400


On Fri, 2001-09-21 at 20:46, Adam Williams wrote:
> >I guess I could have put this thread on the members.  I wanted this
> >message to be more of a request for a presenter when I first started it.
> 
> Well,  it wouldn't be until 2002.  But it is something I could certainly
> demo.  I still use terminals (love them), but does anyone else?

I love them when they work.  At home and at work I have terminals
direcly connected to a serial port.  They are emulating wyse50 terminals
and the inittab includes the following line.

S1:2345:respawn:/sbin/getty ttyS0 DT38400 wyse50

Everything works with the exception of the arrow keys which do not
respond at all.  The Liberty brand terminals can be set to eulate other
term types like DECVT200, DECVT100, ALTOS-VII, TELEVIDEO 950, WYSE50,
should I be trying different terminal types or should I be trying to
change terminf/termcap?

I'm quite interested because I will need to get our new app working from
terminals!
> 
> >>>I would really appreciate a little background on terminal definitions,
> >>>termcap, terminfo, $TERM.  My understanding is that $TERM is the
> >>>environment variable that an application checks to determine how it should
> >>>behave.  The ap then assumes it is being run from a terminal of this type
> >>>and consults terminfo or termcap to determine that behavior.  The TERM
> >>>variable and has nothing to do
> >>>with the behavior of the shell or the xterm that shell is running in.  I
> >>>have two machines whcih are RH 7.0 machines.  When I backspace from a login
> >>>prompt or from within vi or from within the business application we have
> >>>recently purchased it prints ^H and drives me up a wall.  When I read
> >>Mmmmm, yes.  Had that.  Lots of fun.
> >>>http://www.linuxdoc.org/HOWTO/mini/BackspaceDelete/index.html I feel
> >>>like I have not taken the prerequisite coursework.
> >>>I was hoping I would be able to solve this issue without spending an
> >>>entire weekend reading and attempting to learn from the documentation.  I
> >>Ha!
> >>>already have spent more time trying to solve this issue than I desired.  I
> >>>can now add terminals to the things I love about information systems  ..
> >>>right up there with modems initialization strings and printer escape codes.
> >> What is your client (a term emul on win32)?
> >> What is your $TERM value?
> >baipro= our new business software
> >me:
> >gnome-terminal on workstation rh7.1 ssh into server rh7.0
> 
> Your TERM should be "xterm".  But I can honestly say I have never seen a
> term emul problem linux to linux.
echo $TERM
xterm

> 
> >	vi: only thing noticed is backspace key gives ^H
> 
> In termcap :bs: designates that ^H performs a backspace.  Make sure that
> this is "enabled" in your termcap.  The bc tag designates the backspace
> string if it is not ^H.
:bs: is en by /etc/termcap for the vt100 entry.   Everywhere that
backspace does not work, control H does work.  So the aggravation seems
to be somewhere between the operator entering backspace and ^H not
affecting the application.

> 
> In terminfo kb or kbs specifies the backspace string
> 
> The command infocmp will dump your terminfo definition to stdout  (as they
> are stored as compiled binary).
infocmp vt100 has the following line.
ka3=\EOs, kb2=\EOr, kbs=^H, kc1=\EOp, kc3=\EOn, kcub1=\EOD,
> 
> 
> >	biapro: from an xterm no response from backspace.  baipro changes my
> >$TERM variable to vt100 when initializing.
> 
> Ah,  software should not be changing TERM values.  Possible that baipro
> uses its own termcap?  AcuCOBOL, IQ, Uniplex UBS, Informix 4gl, etc...
> many UNIX apps do implement their own termcap instead of using the system one
> (REALLY STUPID!!!)
Agreed, the operating system should be responsible.
> 
> If so it may not know xterm and thus force the value to the default vt100.
The application does have an interface to affect terminal information.
I added xterm as a copy of vt100 and re logged in.  It still switched
the term variable to vt100.
> 
> >my users
> >	use wintegrate terminal emulation software (telnet), when they log in
> >with name and passwd backspace yeilds ^H and they must type username and
> >passwd without error.
> 
> This is "normal".  Most systems don't let you "fix" your username or
> password.
> 
> >wintegrate is set to emulate wyse60
> 
> Ah.  There are no wyse60 emulators for Linux,  at least that I have found
> (and believe me, I've looked).
There are also no ansi emulators.  I always hope for an x app that would
be similar to one of the win32 commercial terminal emulators.  Can't
find one.
> 
> >>Often times the term emul isn't sending the right bksp value and can be
> >>adjusted.
> >>Have you identified if you are using terminfo or termcap?  For vim I'd assume
> >>terminfo.
> 
Is there a way to figure out which is being used?  

One other interesting thing I found which I don't know what 
it means is that the command stty gives different results depending on wheather
if I am on my 7.1 machine I get 

$ stty -a
speed 38400 baud; rows 55; columns 81; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

When on the problem machine

$  stty -a
speed 38400 baud; rows 55; columns 77; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = <undef>; stop = <undef>; susp = <undef>;
rprnt = <undef>; werase = <undef>; lnext = <undef>; flush = <undef>;
min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon
-ixoff -iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

Notice the different entry for erase=

Dirk