Skip to content

Instantly share code, notes, and snippets.

@sacsbrainz
Created August 23, 2025 09:48
Show Gist options
  • Select an option

  • Save sacsbrainz/b61a67c9498e01b2fc2852e091b173de to your computer and use it in GitHub Desktop.

Select an option

Save sacsbrainz/b61a67c9498e01b2fc2852e091b173de to your computer and use it in GitHub Desktop.
Fix Error opening terminal: xterm-ghostty

Option 1: Override TERM just for SSH

Add this to your ~/.ssh/config on Your local pc:

Host *
  SendEnv TERM
  SetEnv TERM=xterm-256color

This ensures every SSH session tells the remote side “I am xterm-256color” instead of xterm-ghostty.

Option 2: Change TERM automatically in Ghostty

Ghostty lets you configure the $TERM it sets. In your Ghostty config file (on NixOS, usually ~/.config/ghostty/config), add:

term = xterm-256color

Now every new Ghostty window reports itself as xterm-256color, which is understood by tmux and almost all servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment