views:

774

answers:

4

Hello,

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.

A: 

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.

Nic Wise
+1  A: 

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
Lucas Oman
Agree :-) But bad habits are hard to forget.Thanks
Luc M
^ and $ don't work while in insert mode...but Home and End do. Having to hit esc,$,i is three times as much work as just hitting End. Same for arrow keys, can't use hjkl while in insert mode.
davr
Not a problem for most users, because you should change your habits so that the only thing you ever do in insert mode is actually, y'know, insert.
ephemient
ctrl-f/ctrl-b move full pages at a time. Ctrl-u/d can actually do different things, depending upon the setting of 'scroll' (default is 1/2 page). Oh, and consider this an excellent reason to break bad habits.
Zathrus
A: 

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.

feoh
I'm connecting to an Alpha with SmarTerm, a Window application. No Unix here.There's no difference between telneted session and normal session when I type SHOW TERMINAL except "Remote Port Info: Host " and "Owner"One remote is my Pc and the other one is the Alpha.
Luc M
There's still terminal emulation involved. I have no idea what emulation SmarTerm is using, or what terminal the 2nd VMS box thinks you have, but the two clearly do not agree.
Zathrus
do a SET TERM/INQUIRE and the host will ask the terminal emulator what it is and set the terminal to that type. At that point, a SHOW TERM will tell you what the terminal emulator claims to be.
EvilTeach
+1  A: 

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
ngn
ThanksI'll apply the Lucas Oman solution: ctrl-u,ctrl-d...
Luc M