tmux: open terminal failed: missing or unsuitable terminal: xterm-256color
Solution 1
Your system doesn't have xterm-256color
. You could:
Set
TERM
to something other thanxterm-256color
outsidetmux
(try just plainexport TERM=xterm
).See if there is a package containing
xterm-256color
, perhaps a later version of ncurses or terminfo.Install it manually from another system with something like:
infocmp -x xterm-256color > out
Then transfer the "out" file to your Mac and try:
tic out
Solution 2
This happened to me during a system upgrade. Unfortunately I did not see a way besides restarting: tmux kill-server
and then run tmux
.
Solution 3
you can just type export TERM=xterm
in console when you see this error, or put export TERM=xterm
in the file ~/.bash_profile
and source ~/.bash_profile
. then you may never get this error again.
This works fine on my debian.
Solution 4
TL;DL
sudo ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color
Details
Maybe the file /usr/share/terminfo/x/xterm-256color
is corrupted. It may be fixed upon (system/package) upgrade / reinstall.
Meanwhile you can use other terminfo entry. You can get the available options by ls /usr/share/terminfo/x
.
I am having the same problem and using xterm-16color
meanwhile.
To set terminfo, you can type reset
in the terminal, then select the terminfo:
username:~$ cd /usr/share/terminfo/x
username:x$ ls
x10term xnuppc+200x64 xterm-24 xterm+pcfkeys
x1700 xnuppc-200x64-m xterm-256color xterm-pcolor
x1700-lm xnuppc-200x75 xterm+256color xterm-r5
...
username:x$ reset
reset: unknown terminal type xterm-256color
Terminal type? xterm-16color
=== Edit 2018 Feb 20 ===
You should config the term in many places if you want to make to permantent, for example, .vimrc, .tmux.config, .Xresources, e.t.c.
I still have issue when using terminator -x 'tmux attach -t music; exec bash'
So I'm using a quick hack as below:
cd /usr/share/terminfo/x
sudo mv xterm-256color xterm-256color.bk
sudo ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color
Solution 5
When I removed some sessions/windows this error went away for me. Apparently I had too many TTY's open.
You can kill sessions/windows from outside tmux with these commands:
tmux kill-session -t <session-name>
tmux kill-window -t <session-name>:<window-name>

user3256740
Updated on July 22, 2021Comments
-
user3256740 over 1 year
I used home-brew to setup tmux on a mac. When trying to run tmux I keep on getting this error
open terminal failed: missing or unsuitable terminal: xterm-256color
any suggestions?
-
dotslash almost 7 years
export TERM=xterm
Thanks it even works in OpenWRT whose 'tmux' has less functionalities. -
Leon Adler over 4 yearsArch users: This is the answer you are looking for.
-
Pistos over 4 yearsNot just Arch. Probably generically Linux. And you don't have to kill your servers ungracefully. In the shell, before you try to reattach, set TERM to some other value, such as
export TERM=xterm
orexport TERM=screen
, then you can reattach. At that point, you can end all your programs and shells gracefully. Once all the tmux sessions for the same user are ended, you can restart tmux with the new version. -
Jim Stewart over 4 yearsNot even generically Linux. I had to do this after updating MacPorts while tmux was running. Fortunately I saw this before trying more radical solutions.
-
isaaclw over 2 yearsI didn't want to kill tmux, because then I would have no way to interact with the upgrade.
export TERM=xterm
was the solution. -
Tomáš M. about 2 yearsinfocmp & tic was what exactly what I was looking for (not even backspacing worked before that)