Ssh – Tmux under Kitty terminal

kittysshtmux

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?

Best Answer

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.

Related Question