R – Why vim doesn’t work correctly into a telnet session

escapingtelnetterminal-emulatorvimvms

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.

Best Answer

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