Xterm and VT Emulation

Many years ago, when I was writing this book I did so using a Linux desktop using Xterm and the following configuration script.

#!/bin/sh
# vax
# 09-17-96 Bob Ess - initial creation
# 09-26-96 Shig Katada - Additional keybindings
#
# Script file to incorporate keybindings and command line
# options for connecting to a VAX node

# Usage statement
Usage(){
 echo
 echo " Usage : vax -options"
 echo
 echo " Options: -80 for 80 column terminal"
 echo " -132 for 132 column terminal"
 echo " -fg colorname"
 echo " -bg colorname"
 echo " -fn fontname"
 echo " -fb bold fontname"
 echo " -host [altair] [devel] [leonis] [castor]"
 echo ""
 echo " Example: \"vax -80 -fg white -bg black -fn 9x15 -fb 9x15b -host castor\""
 echo " Starts a VAX session with an 80 column terminal"
 echo " with a black background, white foreground, a normal"
 echo " font of 9x15 and a bold font of 9x15b, and connects"
 echo " to the node 'castor'"
 echo
 echo " If you need additional help, please call Workstation"
 echo " Services at x92396."
 echo
 exit 1
}


# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to castor by default.
#
 FG=yellow
 BG=black
 HOST=192.168.1.8
 FONTFAMILY="Liberation Mono"
 COLS=80

xterm -title "VAX" -132 -sb -sl 4000 -bc -geo ${COLS}x32 -fg ${FG} -bg ${BG} \
 -cr red -fa "$FONTFAMILY" -xrm \
 'XTerm*VT100.translations: #override \n\
 ~Shift <Key>F1: string(0x1b) string("OP") \n \
 ~Shift <Key>F2: string(0x1b) string("OQ") \n \
 ~Shift <Key>F3: string(0x1b) string("OR") \n \
 ~Shift <Key>F4: string(0x1b) string("OS") \n \
 ~Shift <Key>F5: string("Break") \n \
 ~Shift <Key>F6: string(0x1b) string("[17~") \n \
 ~Shift <Key>F7: string(0x1b) string("[18~") \n \
 ~Shift <Key>F8: string(0x1b) string("[19~") \n \
 ~Shift <Key>F9: string(0x1b) string("[20~") \n \
 ~Shift <Key>F10: string(0x1b) string("[21~") \n \
 ~Shift <Key>F11: string(0x1b) string("[23~") \n \
 ~Shift <Key>F12: string(0x1b) string("[24~") \n \
 Shift <Key>F1: string(0x1b) string("[23~") \n \
 Shift <Key>F2: string(0x1b) string("[24~") \n \
 Shift <Key>F3: string(0x1b) string("[25~") \n \
 Shift <Key>F4: string(0x1b) string("[26~") \n \
 Shift <Key>F5: string(0x1b) string("[28~") \n \
 Shift <Key>F6: string(0x1b) string("[29~") \n \
 Shift <Key>F7: string(0x1b) string("[31~") \n \
 Shift <Key>F8: string(0x1b) string("[32~") \n \
 Shift <Key>F9: string(0x1b) string("[33~") \n \
 Shift <Key>F10: string(0x1b) string("[34~") \n \
 Shift <Key>F11: string(0x1b) string("[28~") \n \
 Shift <Key>F12: string(0x1b) string("[29~") \n \
 <Key>Print: string(0x1b) string("[28~") \n \
 <Key>Cancel: string(0x1b) string("[29~") \n \
 <Key>Pause: string(0x1b) string("Om") \n \
 <Key>Insert: string(0x1b) string("[2~") \n \
 <Key>Delete: string(0x1b) string("[3~") \n \
 <Key>Home: string(0x1b) string("[1~") \n \
 <Key>End: string(0x1b) string("[4~") \n \
 <Key>Prior: string(0x1b) string("[5~") \n \
 <Key>Next: string(0x1b) string("[6~") \n \
 <Key>BackSpace: string(0x7f) \n \
 <Key>Num_Lock: string(0x1b) string("OP") \n \
 <Key>KP_Divide: string(0x1b) string("OQ") \n \
 <Key>KP_Multiply: string(0x1b) string("OR") \n \
 <Key>KP_Subtract: string(0x1b) string("OS") \n \
 <Key>KP_Add: string(0x1b) string("Ol") \n \
 <Key>KP_Enter: string(0x1b) string("OM") \n \
 <Key>KP_Decimal: string(0x1b) string("On") \n \
 <Key>KP_0: string(0x1b) string("Op") \n \
 <Key>KP_1: string(0x1b) string("Oq") \n \
 <Key>KP_2: string(0x1b) string("Or") \n \
 <Key>KP_3: string(0x1b) string("Os") \n \
 <Key>KP_4: string(0x1b) string("Ot") \n \
 <Key>KP_5: string(0x1b) string("Ou") \n \
 <Key>KP_6: string(0x1b) string("Ov") \n \
 <Key>KP_7: string(0x1b) string("Ow") \n \
 <Key>KP_8: string(0x1b) string("Ox") \n \
 <Key>KP_9: string(0x1b) string("Oy") \n \
 ~Shift <Key>Up: string(0x1b) string("[A") \n \
 Shift <Key>Up: scroll-back(1,lines) \n \
 ~Shift <Key>Down: string(0x1b) string("[B") \n \
 Shift <Key>Down: scroll-forw(1,lines) \n \
 <Key>Select: select-start() \n\
 <Key>0x1000FF02: select-end(CUT_BUFFER0) \n\
 <Btn1Down>: select-start() \n\
 <Btn1Up>: select-end(PRIMARY, CLIPBOARD, CUB_BUFFER0) \n\
 Shift<Btn1Down>: select-start() \n\
 Shift<Btn1Motion>: select-extend() \n\
 Shift<Btn1Up>: select-end(CLIPBOARD) \n\
 Shift<Btn2Up>: insert-selection(CLIPBOARD) \n\
 Shift<Btn3Down>: start-extend() \n\
 Shift<Btn3Motion>: select-extend() \n\
 Shift<BtnUp>: select-end(CLIPBOARD)\n'\
 -e telnet $HOST &

Oh, don’t be whining and sniveling about using telnet, you can use SSH if you want, but, remember you either have to have one script for each user you wish to log in as, or, you have to pass another command line parameter to identify the user.

Recently I was trying to use this on my DS-10 and LSE wretched up on the screen. I fought things for a while and then I identified the problem. Recent/current versions of xterm respond as VT400_series, which xterm MOST CERTAINLY CANNOT DO. Previously my LOGIN.COM had SET TERM/INQ for interactive logins because that always worked in the past and it was necessary with xterm. Today your LOGIN.COM needs to have this.

$ if f$mode() .eqs. "INTERACTIVE"
$ then
$ set term/dev=vt100/page=32/width=132/insert
$ endif

LSE is happy as a clam and doesn’t care about a VT-100 having 32 lines.

PuTTy appears to have similar problems. At least the one with KDE NEON, currently a YABU based on Ubuntu LTS. It has a completely incorrect response for SET TERM/INQ which makes LSE vomit profusely when you try to edit a file. PuTTy will let you configure a VT100 with 32 lines, but, something about the way it responds to LSE tells LSE to chop the edit window down to the physical limitations of an actual VT-100.

Just passing this along in case someone stumbles into it.

2 Comments

  1. This side of 2015 you will find telnet and ftp ports disabled, and if you have security people looking over your shoulder then you will not be allowed to enable them (nor should you want to). Then a cut in corporate IT budgets has made it impossible to authorize the purchase of a good terminal emulator which has forced most people to use Tera Term Pro ( http://logmett.com/tera-term-the-latest-version ) or PuTTY. These beasts will usually identify themselves as “xterm” which works well enough with editors like nano or vim. Depending upon the OpenVMS system, there is little benefit it changing the identity to anything higher than vt300. Adding support for x11 usually involves acquiring cygwin/x or Xming then restricting your connectivity to the ssh port to keep the security folks happy. Things were so much easier with Reflection (or Reflection X) which has been passed like a football from WRQ to Attachmate to MicroFocus. Back to OpenVMS for a moment, one of my peers has resorted to using VIM rather than EDT or EVE. How things have changed.

    • I know, but it is my machine and it is only powered on when I am working on a project. At one point I had it on its own network. If I was using it for any kind of production work it would be air gapped again.

      I’m just shocked at how poorly Linux terminal emulators are maintained. __EVERY__ time someone wants to use another key with VIM, the 12 year old boys who maintain them simply delete the definition so it doesn’t interfere with VIM.

      Do you realize there was a time when Konsole’s VT-420 emulation actually worked? Numeric keypad and everything. No longer the case now.

      What really honked me off is Xterm changing the response to indicate it was a VT400_Series when it is NOT EVEN CLOSE.

      Too many PC weanies claiming VT compatibility when none of them know what VT is.

Leave a Reply