'Xterm-New': Unknown Terminal Type

Replicating the error:

  1. I am using iTerm2 on Macbook (OS X Yosemite)

  2. I ssh into a remote instance and tried to run the clear command and this error is shown:

    'xterm-new': unknown terminal type.

  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.

  4. The error occurs only when I use iTerm2 and not when I use the default Mac Terminal. So I am guessing this problem has something to do with iTerm2 and not the virtual machine.

How can I solve this problem with iTerm2?

4

1 Answer

As mikyra pointed out in the comments above, setting the environment variable TERM=xterm-256color solves the problem.

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. The same xterm-new error should not occur now.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest