Quote:> I've been spending some time recently connecting various dumb terminals
> to the serial lines on some linux boxen in my office. To all intents and
> purposes these terminals appear to be working correctly. However, the
> character map translations are causing some frustration, and I was
> hoping for some help in this regard: specifically, the "special" keys
> (such as cursors, Page Up, Page Down, etc.) on the keyboard are not
> behaving as they ought. We are using pre*ly Wyse terminals and
> have set up getty to treat them as such, and the termcap contains the
> correct information with regard to these terminals, but instead of
> having e.g. cursor down moving the cursor down, I get a line-feed. For
> various reasons, all of them _legacy_ (I don't wanna talk about it since
> it makes me want to cry), it is not practical to change the terminal
> emulation to VT100.
> So the question is: is it possible to run these terminals in wyse-50
> mode, and get the use of the cursor keys in bash, emacs, pine, etc. or
> am I stuck with ^P, ^N, ^B, ^F or whatever else I would be reduced to?
This is the norm - by default left generates a backspace and down a
linefeed. If you don't like this 'helpfull' feature, you can
reprogram the cursor keys to produce something else, for example VT100
style codes, provided you define yourself a new termcap or terminfo entry
with the appropriate changes made.
We have a number of old Link 125 terminals here that emulate wyse-50s.
Here's my notes on how I set them up for our terminfo based system, I'll
leave it for you to figure out how to do this with termcap.
=============================================================
Configuring a Link 125 terminal for Linux
=========================================
We have a number of Visa Link 125 terminals (some have been re-badged
'Crystal'), which I have found make excellant Linux terminals.
These terminals are used in WYSE 50 emulation mode. By default
this has silly codes for the cursor keys (left=backspace and down=newline),
but it is possible to reprogram them to produce more sensible (but non
standard) codes.
The following may or may not be applicable to other terminals that have
WYSE 50 emulation.
1 Host configuration :
The line of inittab that runs getty on the line should specify a term
type of wy50ak. This is a non-standard type we will define. It's
basically a standard wyse50 type with VT100 style cursor key codes
and auto margin capability removed. You also need to give getty the
'-h' option to turn on hardware handshaking (linux alternative getty).
==== file wyse50ak.src =============
wy50ak|wyse50ak|Wyse 50ak,
bw, hs, mc5i, mir, msgr, xon,
cols#80, lh#1, lines#24, lw#8, ma#1, nlab#8, wsl#45,
acsc=0wa_h[jukslrmqnxqzttuyv]wpxv, bel=^G, cbt=\EI,
civis=\E`0, clear=\E+$<20>, cnorm=\E`1, cr=^M, cub1=^H,
cud1=^J, cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c,
cuu1=^K, dch1=\EW$<1>, dim=\E`7\E), dl1=\ER, dsl=\EF\r,
ed=\EY$<20>, el=\ET, flash=\E`8$<100/>\E`9, fsl=^M,
home=^^, ht=^I, hts=\E1, il1=\EE, ind=\n$<2>, ip=$<1>,
is1=\E`\072\E`9$<30>, is2=\016\024\E'\E(, kHOM=\E{,
kbs=^H, kcbt=\EI, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
kf10=^AI\r, kf11=^AJ\r, kf12=^AK\r, kf13=^AL\r, kf14=^AM\r,
kf15=^AN\r, kf16=^AO\r, kf2=^AA\r, kf3=^AB\r, kf4=^AC\r,
kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r,
khome=^^, kich1=\EQ, kil1=\EE, knp=\EK, kpp=\EJ, kprt=\EP,
krpl=\Er, ll=^^^K, mc0=\EP, mc4=^T, mc5=^X, nel=^M^J,
pfx=\Ez%p1%'?'%+%c%p2%s\177,
pln=\Ez%p1%'/'%+%c%p2%s\r, prot=\E`7\E), rev=\E`6\E),
ri=\Ej, rmacs=\EH^C, rmir=\Er, rmln=\EA11, rmso=\E(,
sgr=%?%p1%p3%|%t\E`6\E)\n%e%p5%p8%|%t\E`7\E)%e\E(%;\n%?%p9%t\EH\002%e\E$
sgr0=\E(\EH\003, smacs=\EH^B, smir=\Eq, smln=\EA10,
smso=\E`6\E), tbc=\E0, tsl=\EF,
================================
Run 'tic wyse50ak.src' as root which compiles this file and puts it in the
right place (/usr/lib/terminfo/w/wyse50ak).
(If you need termcap support as well you'll also need to convert this to a
termcap entry.)
As this is a non standard type it may be awkward when accessing remotes hosts.
You should be able to use the 'screen' program to convert your terminal to
VT100, however.
2 Terminal configuration
You will need to reprogram the cursor keys to produce the VT100 style codes,
by typing the following sequences on the terminal's keyboard. Unfortunately
the terminal seems to give no visual feedback whatsoever, so make sure you
get them right!
Up:
SHIFT-ESC
| (press shift \)
-
1
ESC
[
A (must be capital)
CTRL-y
Down:
SHIFT-ESC
|
.
1
ESC
[
B (must be capital)
CTRL-y
Right:
SHIFT-ESC
|
0
1
ESC
[
C (must be capital)
CTRL-y
Left:
SHIFT-ESC
|
/
1
ESC
[
D (must be capital)
CTRL-y
You should now find the arrow keys generate the sequences ^[[A through to
^[[D .
Going into setup (shift-setup) and pressing S for save seemed to permanently
save these settings, although this may not even have been necessary.
Other notable settings:
Auto newline should be off (pine is buggy and assumes no automargins)
Auto scroll should be on
Handshaking should be set to DTR
Note on handshaking:- Linux uses RTS/CTS whereas the terminals use DTR
Without handshaking the terminals didn't work properly above 2400bps,
but using a cable with DTRs wired to DSR and CTS on the other end it
seems fine at 19200 (which is faster than the terminals can update the
screen). The cable also wired RTS to DCD on the other end. Handshaking
is only really needed from the terminal to the host.
Ben McKeegan
December 97
=============================================================
--
/ Ben McKeegan \
\ Fitzwilliam College, University of Cambridge, UK. /