Fixing Ghostty terminfo errors on Ubuntu (Snap install)

When Ghostty is installed via Snap on Ubuntu, it may advertise TERM=xterm-ghostty without registering the corresponding terminfo entry on the host system. This breaks ncurses applications locally and over SSH. The fix is to extract the compiled terminfo entry from the Snap and install it into the user-local terminfo directory, then propagate it to remote systems if needed.

Problem

Context

Ghostty installed via Snap on Ubuntu

Symptom

Local and remote terminal applications fail with errors such as: 'infocmp: couldn't open terminfo file /usr/share/terminfo/x/xterm-ghostty'.

Root cause

Ghostty sets TERM=xterm-ghostty, but the Snap package does not register the compiled terminfo entry with the host system's terminfo database. As a result, ncurses cannot find the terminal definition.

Impact

  • ncurses-based programs fail or behave incorrectly.
  • Issues occur even without SSH.
  • SSH sessions inherit the broken TERM value and fail on remote systems.

Solution

Extract the compiled xterm-ghostty terminfo entry from the Ghostty Snap package and install it into the user's local terminfo directory, then copy it to remote systems if needed.

  1. Locate terminfo inside the Snap package

    snap run --shell ghostty -c 'find "$SNAP" -type f -path "*terminfo*" | grep xterm-ghostty'

    This locates the compiled xterm-ghostty terminfo file shipped inside the Snap sandbox.

  2. Install terminfo locally (no root required)

    mkdir -p ~/.terminfo/x && cp <snap-path>/xterm-ghostty ~/.terminfo/x/

    Installing to ~/.terminfo ensures ncurses can find the entry without modifying system directories.

  3. Verify the installation

    infocmp xterm-ghostty

    A successful capability dump confirms the terminfo entry is now registered.

  4. Propagate to remote systems (optional)

    infocmp -x xterm-ghostty | ssh <remote-host> -- tic -x -

    This installs the same terminfo entry on remote hosts for SSH compatibility.

Result

Ghostty works correctly on Ubuntu with Snap, ncurses applications function normally, and SSH sessions no longer fail due to missing terminfo entries.

  • No need to downgrade TERM.
  • No system-wide changes required.
  • Consistent terminal behavior locally and remotely.

Notes

Recommended practice
Use user-local terminfo installation for Snap-based terminals when host registration is missing.
Fallback option
As a last resort, set TERM=xterm-256color for maximum portability, at the cost of Ghostty-specific features.

LinkedIn

linkedin.com

GitHub

github.com