Arrow keys turn into control characters in Telnet

落爺英雄遲暮 提交于 2019-12-02 14:34:27

问题


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.


回答1:


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.

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.




回答2:


I would either SSH into the server instead of telnet, or use puTTY.



来源:https://stackoverflow.com/questions/7247986/arrow-keys-turn-into-control-characters-in-telnet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!