English 中文(简体)
为什么vim在telnet会话中不能正常工作?
原标题:
  • 时间:2008-10-31 17:15:38
  •  标签:

我在 OpenVMS V7.3-2 上使用 vim (7.1)。

我通过一个终端仿真器SmartTerm的Telnet会话连接到VMS。

它运行得很好。

但是,当我从通过SmartTerm连接的VMS会话开始telnet会话到另一个VMS会话时,某些键无法正常工作。

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

插入、删除、首页、末页、上翻页和下翻页在正常模式下类似于~(将大写字母变为小写或相反)。

有什么想法吗?

这里是翻译成中文的地方。

编辑

我突然意识到我没有提到第二个telneted会话在同一台VMS箱子上。

我这样做是因为我需要处理另一个用户的权限。

最佳回答

除了调整使用的终端仿真外,学习 vim 的按键操作对于你正在执行的操作也是一个好主意。这些更加可靠,不依赖于终端或键盘。例如:

  • 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
问题回答

我在恢复一个尘封的旧 Solaris 箱子时遇到了类似的问题。我太懒了,不想搜索如何正确设置我的 t_ 变量,所以我重新映射了有问题的终端转义序列:

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

如果你想正确设置这个该死的东西,阅读操作手册可能会耗费相当多的神经和时间:

:h terminal-options

通常是由于终端仿真-所以某些东西没有传递正确的密钥。我已经很久没有做过这个了,但是寻找像VT-100之类的东西。我怀疑它也不是特定于vim的:)

对不起,我不能提供更多帮助。

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!




相关问题
热门标签