• Please review our updated Terms and Rules here

Termcaps for VT100

That above pic is really a specific config file.. You can ignore it.. sorry.. I did find this useful info though from a website..

Discussion:
vt220 Home/End Key Mapping
Pavil Natanovich
20 years ago

I'm using vt220 emulation to connect windows PCs to a server running
Linux.

The emulator maps the function keys F1-F5 to \EOP through \EOT (or at
least it does now). F6-F9 are \E[17~ through \E[20~, and I changed
these in my termcap file so that they now function.

One key I'm still having trouble with is the "end" key. It is mapped
to:

\E[4~

The home key (\E[1~) works. It repositions the cursor to the
beginning of the line. I want the "end" key to reposition the cursor
to the end of the line.

Here is my termcap entry:

# VT-200 - the function keys are mapped as follows:
# f1-4 are pf1 - pf4, f5-f8 are f17 - f20.
# This is convenient due to the lack of an "F5" on the VT200 keyboard
# and the location of F17-F20 right above the first four function
keys.
# Function keys 9 and 10, however, are the keys labelled "F9" and
"F10".
vt220|VT220|vt-220|svt1210|svt1220|a220|ampex-220|VT-200|DEC VT-220:\
:al=\E[L:dl=\E[M:KI=\E[2~:KX=\E[3~:K?=\E[28~:vi=\e[?25l:ve=\e[?25h:\
:kN=\E[6~:kP=\E[5~:KD=\E[29~:KM=\E[4~:KF=\E[1~:\
:GO=\E(0:GF=\E(B:GM=qxlkmjvtwun:W3=\E[?3h:W8=\E[?3l:\
# :k5=\E[31~:k6=\E[32~:k7=\E[33~:k8=\E[34~:k9=\E[20~:k0=\E[21~:tc=vt100:
# :k5=\EOT:k6=\EOU:k7=\EOV:k8=\EOW:k9=\EOX:k0=\EOY:tc=vt100:
:k5=\EOT:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k0=\E[21~:\
:kh=\E[1~:el=\E[4~:tc=vt100:


KM=\E[4~ on the second line, which is some sort of key macro thing.
If I remove this the escape is peeled off and the rest of the sequence
gets echoed to the screen, regardless of what I set \E[4~ to on the
last line (after kh).

ch, kH, kE, @7, *6 all do nothing.
 
So I think my issue is there is no F1 - F4 on the VT220 keyboard by looking at one online... but there is a F1 - F4 on the VT100. Is there a way I could map in the VT220 the terminal caps for the VT100 for F1 - F4? Is that the "tc=" in the script??
 
Please use [ CODE ] tags when posting termcap files. The way you do it (with formatting and adding random text in the middle) is worse than bad, and you are wasting screen content by copying irrelevant stuff.

This is the output I just tried out and got.
Yes, this is "trial and error". Please stop doing it because you are wasting everyone's time. You probably won't even get far (and even if you do, you probably won't know how or why). It's not a good idea to spam with random information.

The VT-100 only has four function keys (PF1, PF2, PF3, PF4). Therefore, only these function keys have well-known escape sequences ("ESC O P" to "ESC O S"). Anything beyond that depends on your terminal emulator, and there are multiple standards. For example, a true "VT-100" terminal emulator will simply ignore the F5 key, because that key does not exist on a VT-100.

For example, my Linux machine (within xterm) outputs "ESC [ 1 5 ~" for F5, and "ESC [ 1 7 ~" (not a typo) for F6. The same machine on the local console outputs "ESC [ [ A" for F1, which is not even VT-100 compatible. Combinations like Shift+F2 or Shift+Ctrl+F6 are even more complex.

There are no universal standards. You chose your software, you better understand how it works. Xenix may be old and painful, but don't hold it accountable for issues it is not responsible for. Be nice to Xenix, it has seen enough hate. :)
 
I was just posting my progress to document what I've found, thinking this might be useful information to someone in the future. I have not been using the VT100 in the emulator for a bit now. I have been using it in VT220 mode, which doesn't have function keys 1-4. I have found you can modify lines in the termcap files for a particular lines to map to another terminal type such as the VT100. You can enter something possibly like "k1:\tc=vt100"... although I think that is wrong. I think there is format in the termcap based on the line. So in essence if I can figure out where to insert that code in the VT220 code it would hypothetically use the PF1-4 keys (only) that are on the VT100. I've made a lot of progress so far actually. I want to say I have eliminated about 95% of the issues now that I originally had.

And I actually love the Xenix OS.. as I began tinkering with it going back to 1994.. but I didn't do much tinkering with any code or termcap files. I was mostly spending hours on BBS's.. Back then having the terminal was all you had. Sitting in bed with a CRT tinkering isn't as convenient as being able to connect wirelessly on my laptop through a terminal emulator.
 
Well I've reverted back to the VT100. Yes it only has P1-4 for keys. The emulation basically runs perfect now except for one application that wants more than four function keys. So what I did do is look through a long list of what terminals were supported in the original termcap file. The closest I could find was a Wyse 85. I've gotten all the termcap files modified to include the Wyse 85 and it does work. Problem is there really isn't any terminal emulators out there that I have found yet that include the Wyse 85. Procomm has the Wyse 50, 60, 75, and 100.. but the 85 is missing. It does work with the Wyse 75 but the keymapping is off.. Now I can customize it with a handy dandy utility program that Svenska wrote (works excellent by the way). After all this work I just will keep a search out for an emulation program that has the Wyse 85 in it. For now the VT100 works flawlessly except the one program that uses function keys 1-12.. anyways.. that's the latest. Each program I created a new termcap file for in their associated directories, a nice clean one for each with the VT100, VT220, and Wyse 85 code in it.
 
Why don't you just extend your vt100 termcap definition with the few keys you need?
 
For reference, IBM Xenix 1.0 ships with the termcap definition below for its "ansi" terminal, which it uses for its local console. Note that this entry does not define any function keys, the keyboard driver simply ignores them. (It also does not understand extended keyboards.)

Code:
li|ansi|Ansi standard crt:\
        :al=\E[L:am:bs:cd=\E[J:ce=\E[K:cl=\E[2J\E[H:cm=\E[%i%d;%dH:co#80:\
        :dc=\E[P:dl=\E[M:dn=\E[B:ei=:ho=\E[H:ic=\E[@:im=:li#25:\
        :nd=\E[C:ms:pt:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:up=\E[A:\
        :kb=^h:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:eo:\
        :GS=\E[12m:GE=\E[10m:GV=\63:GH=D:\
        :G1=?:G2=Z:G3=@:G4=Y:\
        :GU=A:GD=B:GC=E:GL=C:GR=\64:RT=^J:

The vt100/vt132 definitions provided with this version of Xenix only describe F1 to F4 (as expected), and more advanced DEC terminals (such as vt220) are missing.

I've also checked all definitions containing an F6 key (adm31, h19/i19, hp2621, dm3045, vi200, t1061, owl, sb1, some adds, some televideo), and none of them define them in a way compatible with common terminal emulators. At least on my reference system, trial-and-error is guaranteed to fail. You must write your own definitions.

The "handy dandy utility program" is attached here. Should work on any System III, also works on current Linux.
 

Attachments

  • showkey.txt
    1.3 KB · Views: 3
For reference, IBM Xenix 1.0 ships with the termcap definition below for its "ansi" terminal, which it uses for its local console. Note that this entry does not define any function keys, the keyboard driver simply ignores them. (It also does not understand extended keyboards.)

Code:
li|ansi|Ansi standard crt:\
        :al=\E[L:am:bs:cd=\E[J:ce=\E[K:cl=\E[2J\E[H:cm=\E[%i%d;%dH:co#80:\
        :dc=\E[P:dl=\E[M:dn=\E[B:ei=:ho=\E[H:ic=\E[@:im=:li#25:\
        :nd=\E[C:ms:pt:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:up=\E[A:\
        :kb=^h:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:eo:\
        :GS=\E[12m:GE=\E[10m:GV=\63:GH=D:\
        :G1=?:G2=Z:G3=@:G4=Y:\
        :GU=A:GD=B:GC=E:GL=C:GR=\64:RT=^J:

The vt100/vt132 definitions provided with this version of Xenix only describe F1 to F4 (as expected), and more advanced DEC terminals (such as vt220) are missing.

I've also checked all definitions containing an F6 key (adm31, h19/i19, hp2621, dm3045, vi200, t1061, owl, sb1, some adds, some televideo), and none of them define them in a way compatible with common terminal emulators. At least on my reference system, trial-and-error is guaranteed to fail. You must write your own definitions.

The "handy dandy utility program" is attached here. Should work on any System III, also works on current Linux.
Always a wealth of knowledge you are Svenska :) Thank you I will give these options a go :) :)

Thank you :)
 
Back
Top