简体   繁体   English

'xterm-new':未知的终端类型

[英]'xterm-new': unknown terminal type

Replicating the error: 复制错误:

  1. I am using iTerm2 on Macbook (OS X Yosemite) 我在Macbook上使用iTerm2(OS X Yosemite)

  2. I ssh into a remote instance and tried to run the clear command and this error is shown: 我ssh到远程实例并尝试运行clear命令,并显示以下错误:

    'xterm-new': unknown terminal type. 'xterm-new':未知的终端类型。

  3. Not only for the clear command but the same error is displayed for several other commands and the command does not execute as expected. 不仅对于clear命令,而且对于其他几个命令显示相同的错误,并且命令未按预期执行。

  4. The error occurs only when I use iTerm2 and not when I use the default Mac Terminal. 仅当我使用iTerm2时才会出现错误,而不是在我使用默认Mac终端时。 So I am guessing this problem has something to do with iTerm2 and not the virtual machine. 所以我猜这个问题与iTerm2有关,而不是虚拟机。

How can I solve this problem with iTerm2? 如何使用iTerm2解决这个问题?

As mikyra pointed out in the comments above, setting the environment variable TERM=xterm-256color solves the problem. 正如mikyra在上面的评论中指出的那样,设置环境变量TERM = xterm-256color解决了这个问题。

To summarize: 总结一下:

# Run the following commands on the local machine's bash prompt
echo "export TERM=xterm-256color" >> ~/.bashrc
source ~/.bashrc

ssh into remote machine and run the commands you like. ssh到远程机器并运行你喜欢的命令。 The same xterm-new error should not occur now. 现在不应该发生相同的xterm-new错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM