问题描述
我在 Ubuntu 终端中,并且 telnet 到服务器.现在每当我输入 'up' 时,它就会变成 ^[[A.其他箭头键也变成控制字符.有没有办法可以运行 telnet 以便它理解我的箭头键?这将是一个巨大的帮助,因为我想在我的命令历史中向上滚动.
I'm in an Ubuntu terminal, and telnet to a server. Now whenever I type 'up', it turns into ^[[A. Other arrow keys also turn into control characters. Is there a way I can run telnet so it understands my arrow keys? This would be a huge help because I'd like to scroll up in my commands history.
推荐答案
不是 telnet 需要了解您的键产生的转义序列;它是您在远程端输入它们的任何程序.看起来您的 $TERM
环境变量(在远程系统上)没有为您运行 telnet 的终端正确设置.
It's not telnet that needs to understand the escape sequences your keys produce; it's whatever program you're typing them into at the remote end. Looks like your $TERM
environment variable (on the remote system) is not getting set correctly for the terminal you're running telnet in.
自从我使用 telnet 登录以来已经有一段时间了,但是 IIRC 不会自动传输 TERM
,因此您可能需要自己设置.或者,正如 Mike C 所建议的那样,使用 ssh 来代替——这确实会传输 TERM
.
It's been a while since I used telnet for logins, but IIRC it doesn't transfer TERM
automatically, so you may have to set it yourself. Or, as Mike C suggests, use ssh instead -- that does transfer TERM
.
这篇关于方向键在 Telnet 中变成控制字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!