When connecting to a remote host with Ghostty, commands like
clear, tmux, or less may fail with:
'xterm-ghostty': unknown terminal type.
This happens because the remote host doesn't have Ghostty's terminfo entry. Here are
three fixes, easiest first.
Override TERM for a single command:
TERM=xterm-256color clearIn your local ~/.ssh/config:
Host myserver
SetEnv TERM=xterm-256color
Requires
AcceptEnv TERMon the server (often the default). If it's not set, this silently has no effect.
Export your local xterm-ghostty terminfo and install it into the remote user's
~/.terminfo:
infocmp -x | ssh myserver -- tic -x -This is the recommended option: it preserves Ghostty's full terminal capabilities
instead of downgrading TERM. Options 1 and 2 are fine when you just need it working
right now.