Home  >  Q&A  >  body text

ubuntu - ssh 连上服务器之后,终端的上下左右键变成乱码,着急哦~~~!!

ubuntu12.04 在ssh线上机器之后,默认终端的上下左右键失效了,变成了这个,

[evans@app00-000 ~]$ ^[[A^[[A^[[A^[[A^[[A^[[C^[[C^[[B^[[A^[[D^[[C^[[A^[[A^[[A^[[D^[[B^[[C^[[A

,哪位大神可以帮忙啊 跪求 ~!!!!!!

阿神阿神2740 days ago1017

reply all(8)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-21 10:57:56

    Use stty to set the terminal parameters.
    If you don’t know how to set it up, just find a server with no problem, show the parameters, and you will know the difference by comparing the two servers.

    reply
    0
  • 阿神

    阿神2017-04-21 10:57:56

    Many people didn’t get the point. The presence of these characters indicates that there is nothing wrong with the terminal , but the program that accepts the keystrokes, the shell, does not understand the arrow keys correctly. Detect whether the shell is bash or zsh? If it is dash, the edit key is not supported. You can type bash and hit enter to see if that improves.

    Usually knows what shell it is.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-21 10:57:56

    Use

    Shift key + Delete key

    Can be deleted and used temporarily

    reply
    0
  • ringa_lee

    ringa_lee2017-04-21 10:57:56

    Change the character encoding of the local ssh tool, or change the ssh configuration file and change the character set. Or there is a cursor mode in the tool, just select it

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-21 10:57:56

    Type bash and press Enter, try again?

    reply
    0
  • ringa_lee

    ringa_lee2017-04-21 10:57:56

    Same request, I was so stupid when editing, so sad

    reply
    0
  • 高洛峰

    高洛峰2017-04-21 10:57:56

    @DonnieGo
    It works normally when I type bash. I took a look at the file in /etc/passwd and found that the shell field is empty. I think this is the reason.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-21 10:57:56

    @DonnieGo said: type bash and press enter

    Solved!

    To summarize the method once and for all:
    Enter chsh
    Enter /bin/bash after Login Shell [*]
    Every connection will be ok in the future

    reply
    0
  • Cancelreply