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

If you're using [Ghostty terminal](https://ghostty.org/) and getting errors like this when SSH-ing into servers:

```sh
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:

```sh
term = xterm-256color
```

**Config file location on macOS:**

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

**Config file location on Linux:**

```sh
~/.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`:

```sh
Host *
    SetEnv TERM=xterm-256color
```

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