I recently discovered the neat kitty as some aspects of the themes I'm using under ZSH don't render quite right under Xfce Terminal but do under kitty.

Unfortunately I've hit a snag when it comes to using tmux on SSH connections, if SSH from my desktop/server (running Gentoo) to any of my Raspberry Pis (running Arch Linux ARM) or my VPS (also running Arch Linux) and start a Tmux session I'm informed....

open terminal failed: missing or unsuitable terminal: xterm-kitty

However, I've a laptop which is also running Arch and if I SSH to it from my desktop/server and start an SSH session there are no problems, and vice versa, SSHing from laptop to desktop/server and Tmux runs fine.

I should add that I can run Tmux sessions when SSHing to the Raspberry Pis/VPS's that are running Arch Linux if its under an Xfce Terminal.

Any ideas as to how I can investigate or solve this such that Tmux sessions work everywhere?

up vote 7 down vote accepted

If you receive error messages such as "Terminal unknown, missing or unsuitable terminal" upon logging in, this means the server does not recognize your terminal.

The correct solution is to install the client terminal's terminfo file on the server. This tells console programs on the server how to correctly interact with your terminal. You can get info about current terminfo using infocmp and then find out which package owns it.

If you cannot install it normally, you can copy your terminfo to your home directory on the server:

$ ssh myserver mkdir -p  ~/.terminfo/${TERM:0:1}
$ scp /usr/share/terminfo/${TERM:0:1}/$TERM myserver:~/.terminfo/${TERM:0:1}/

After logging in and out from the server the problem should be fixed.

  • 1
    Brilliant, thank your for the clear and succinct explanation and solution. To ease maintenance I opted to install kitty on the remote servers that didn't already have it installed, although I if I ever need to save space I'll adopt the /.terminfo mirroring and add it to my dotfiles. – slackline Sep 22 at 11:05

If you're connected to a machine where it's not possible to install terminfo files, you can set the TERM environment variable to to something that is supported by the machine — profiles that are pretty much compatible with kitty, in decreasing order of preference, include

  • xterm-256color
  • xterm-color
  • xterm
  • vt102

If you want the login shell (e.g. bash) on the remote machine to pick up the correct terminal, you should export it into the environment before running ssh. If you don't care because you're only going to run tmux, you can set it after. Naturally, you will lose some of the cool features of kitty, but in a case where you can't install terminfo and having the basic features takes preference, it can still be handy.

  • This is an error called out in the XTerm FAQ. One should not just blithely go around using the xterm-* entries with things that are not XTerm, and the vt102 entry describes an actual DEC VT 102 which almost all terminal emulators do not in fact emulate. The very premise of this answer is wrong, too. The questioner can install terminfo files, because terminfo (as built on Arch) also looks in one's home directory. – JdeBP Sep 22 at 15:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.