Question

I use vim (7.1) on OpenVMS V7.3-2.

I connect to VMS trough a telnet session with SmartTerm, a terminal emulator.

It works fine.

But when I start a telnet session from a VMS session (connected via SmartTerm) to another VMS session, some keys doesn't work properly.

|--------------| telnet   |-------------| telnet   |-----------------|
|  Smartterm   | ------>  | VMS, Vim OK | ------>  | VMS, Vim broken |
|--------------|          |-------------|          |-----------------|

Insert, Delete, Home, End, PageUp and PageDown are like ~ in normal mode ( upcase to lowercase or vice-versa )

Any idea ?

=============================================

Edit

I just realized that I didn't mention that the second telneted session is on the same VMS box.

I do that because I need to do something with rights from another user.

Was it helpful?

Solution

In addition to tweaking which terminal emulation is used, it's also a good idea to learn vim's keystrokes for the actions you're trying to perform. These are more reliable and don't depend on the terminal or the keyboard. For instance:

  • Insert: i
  • Home: ^ goes to first non-whitespace char, 0 goes to first column always
  • End: $
  • PageUp, PageDown: ctrl-u, ctrl-d move a half-page at a time

OTHER TIPS

I've experienced similar issues while resurrecting a dusty old Solaris box. I was too lazy to search for how I should set my t_... variables correctly, so I remapped the faulty terminal escape sequences instead:

:map xxx 0          (press <C-v><Home> in place of xxx)
:map xxx <C-b>      (press <C-v><PgUp> in place of xxx)
... etc

If you want setup this damned thing right, RTFMing might eat quite some nerve and time:

:h terminal-options

Usually this is because of the terminal emulation - so something isn't passing the right keys thru. It's been ages since I've done this, but look for stuff like VT-100 and the like. I doubt it's specific to vim, either :)

Sorry I can't be more help.

The first question to ask is simply: What are you sitting in front of? Are you really on the console of a VAX or Alpha running OpenVMS? My guess is the answer is no.

In the unlikely event that the answer is yes, simply enter:

$ SHOW TERMINAL

and make sure that the TERM variable on the remote UNIX host matches this exactly.

If my guess is correct and you're sitting in front of a PC or a Mac running some sort of terminal emulator like PuTTY or Terminal, then you need to explore your software's options to ensure that the terminal it's emulating is correctly reflected in both the VMS system's world view and that of the remote UNIX host.

Once you've figured out what kind of terminal you're emulating, use the VMS command above once again on the VMS system you're connected to to ensure that there is a match.

If not, simply correct the situation by typing:

$ SET TERMINAL/DEVICE=(your termainal name - e.g. vt100)

and then make sure that TERM on the remote unix host matches what the VMS system is set to.

Once you do all this, everything should work fine.

In addition to how to set env variables on terminal device compatibility, a tip on the telnet client itself might be useful:

Before usual Esc combination use Ctrl+[, e.g. to quit vim

Ctrl+[ Esc :q!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top