Use when SSHing to a remote host from Ghostty terminal and encountering terminfo errors, missing colors, broken key bindings, or "unknown terminal type" warnings
Ghostty uses xterm-ghostty as its $TERM value. Remote hosts that lack this terminfo entry will show broken terminal behavior. The fix is to transfer the terminfo from the local machine to the remote host.
| Task | Command |
|---|---|
| Check if remote has terminfo | ssh HOST 'infocmp xterm-ghostty >/dev/null 2>&1' |
| Install terminfo on remote |
infocmp -x xterm-ghostty | ssh HOST tic -x - |
| One-liner check + install | ssh HOST 'infocmp xterm-ghostty >/dev/null 2>&1' || infocmp -x xterm-ghostty | ssh HOST tic -x - |
| Verify after install | ssh HOST 'infocmp xterm-ghostty >/dev/null 2>&1 && echo OK' |
If you're already on the machine, just pipe it directly to tic:
infocmp -x xterm-ghostty | tic -x -
infocmp -x xterm-ghostty | ssh user@host tic -x -
This exports the local terminfo and compiles it on the remote host. Only needs to run once per remote machine.
if [ "$TERM" = "xterm-ghostty" ]; then
ssh "$HOST" 'infocmp xterm-ghostty >/dev/null 2>&1' || \
infocmp -x xterm-ghostty | ssh "$HOST" tic -x -
fi
Only runs when connecting from Ghostty, skips if already installed.
infocmp xterm-ghostty fails if the local machine doesn't have the terminfo. Run from Ghostty or a machine with Ghostty installed.-x flag - Both infocmp -x and tic -x need the extended flag to preserve Ghostty's extended capabilities.TERM=xterm-256color before SSH works but loses Ghostty-specific features. Install the terminfo instead.