Fix "Unknown Terminal xterm-ghostty" SSH Error in Ghostty

· Travis Rodgers  · 1 min read

If you’re using Ghostty terminal and getting errors like this when SSH-ing into servers:

tput: unknown terminal "xterm-ghostty"

Here’s the quick fix.

The Problem

Ghostty sets your terminal type to xterm-ghostty, but most servers don’t have this in their terminfo database yet since Ghostty is relatively new. When programs like tput try to look up terminal capabilities, they fail because they don’t recognize xterm-ghostty.

The Solution

Tell Ghostty to use the universally-supported xterm-256color instead. Add this single line to your Ghostty config:

term = xterm-256color

Config file location on macOS:

/Users/YOUR_USERNAME/Library/Application Support/com.mitchellh.ghostty/config

Config file location on Linux:

~/.config/ghostty/config

Save the file, FULLY quit and restart Ghostty, then start a new SSH session. The errors should be gone.

Why This Works

xterm-256color has been around for decades and exists in every server’s terminfo database. Since Ghostty is xterm-compatible (it understands the same escape sequences), declaring itself as xterm-256color works perfectly. You won’t lose any functionality, you’ll still have full color support, and all modern terminal features.

Alternative: Per-SSH Override

If you want to keep xterm-ghostty for local use, you can override it just for SSH by adding this to your ~/.ssh/config:

Host *
    SetEnv TERM=xterm-256color

Though honestly, just changing it in Ghostty’s config is simpler and you won’t notice any difference.

Share:

This page may contain affiliate links. Please see my affiliate disclaimer for more info.

Related Posts

View All Posts »
How to Manage Dotfiles with GNU Stow

How to Manage Dotfiles with GNU Stow

A simple, powerful workflow for managing any Linux dotfiles with GNU Stow. This guide walks you step-by-step through setting up a clean, scalable dotfiles system using a Ghostty config as the example.