为什么 vim 无法在 telnet 会话中正常工作?
我在 OpenVMS V7.3-2 上使用 vim (7.1)。
我通过使用终端仿真器 SmartTerm 的 telnet 会话连接到 VMS。
效果很好。
但是,当我从一个 VMS 会话(通过 SmartTerm 连接)启动 telnet 会话到另一个 VMS 会话时,某些按键无法正常工作。
|--------------| telnet |-------------| telnet |-----------------|
| Smartterm | ------> | VMS, Vim OK | ------> | VMS, Vim broken |
|--------------| |-------------| |-----------------|
插入、删除、Home、End、PageUp 和 PageDown 就像正常模式下的〜(大写到小写或反之亦然)
有什么想法吗?
===============================================
编辑
我刚刚意识到我没有提到第二个远程登录会话是在同一个 VMS 机器上。
我这样做是因为我需要使用其他用户的权限来做一些事情。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
除了调整使用哪个终端仿真之外,学习 vim 的击键来执行您要执行的操作也是一个好主意。 这些更可靠,并且不依赖于终端或键盘。 例如:
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:
我在复活一个布满灰尘的旧 Solaris 盒子时也遇到过类似的问题。 我懒得去寻找如何正确设置我的
t_
... 变量,所以我重新映射了错误的终端转义序列:如果你想正确设置这个该死的东西,RTFMing 可能会吃掉相当多的东西神经和时间:
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:If you want setup this damned thing right, RTFMing might eat quite some nerve and time:
通常这是因为终端仿真 - 所以某些东西没有传递正确的密钥。 我已经很久没有这样做了,但是寻找像 VT-100 之类的东西。 我也怀疑它是特定于 vim 的:)
抱歉我无法提供更多帮助。
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.
要问的第一个问题很简单:你坐在什么前面? 您真的在运行 OpenVMS 的 VAX 或 Alpha 控制台上吗? 我的猜测是答案是否定的。
万一答案是肯定的,只需输入:
$ SHOW TERMINAL
并确保远程 UNIX 主机上的 TERM 变量与此完全匹配。
如果我的猜测是正确的,并且您正坐在运行某种终端仿真器(例如 PuTTY 或 Terminal)的 PC 或 Mac 前,那么您需要探索软件的选项,以确保它所模拟的终端正确反映在VMS 系统的世界观和远程 UNIX 主机的世界观。
一旦您确定要模拟的终端类型,请在您连接的 VMS 系统上再次使用上面的 VMS 命令,以确保存在匹配。
如果不是,只需输入以下命令来纠正这种情况:
$ SET TERMINAL/DEVICE=(您的终端名称 - 例如 vt100)
,然后确保远程 unix 主机上的 TERM 与 VMS 系统的设置相匹配。
一旦你完成了这一切,一切都会正常进行。
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.
除了如何在终端设备兼容性上设置 env 变量之外,有关 telnet 客户端本身的提示可能很有用:
在通常的 Esc 组合使用 Ctrl+[ 之前,例如退出 vim
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