docs/help/terminfo.mdx
Terminfo is an archaic format still in use by many terminal applications to determine the capabilities of the terminal. Ghostty ships with its own terminfo entry to advertise its features.
Ghostty uses the TERM value of xterm-ghostty.
Ghostty packages include the terminfo entry and set the proper filesystem
layouts or environment variables to make it available to the system.
When you run Ghostty, it will automatically set the TERM environment
variable to xterm-ghostty so long as it detects that the terminfo entry
is available.
Ghostty's terminfo entry is available in ncurses 6.5-20241228 and above. As distros update their ncurses packages, Ghostty's terminfo entry will be available by default system-wide. This will take time to propagate.
If you use sudo, sudo may reset your environment variables and you may see
an error about missing or unsuitable terminal: xterm-ghostty or 'xterm-ghostty': unknown terminal type. when running
some programs.
To resolve this, you must either configure sudo to preserve
the TERMINFO environment variable, or you can use shell-integration with
the sudo feature enabled and Ghostty will alias sudo to automatically do
this for you. To enable the shell-integration feature specify
shell-integration-features = sudo in your configuration.
See
shell-integration-features
for more about this configuration option.
If you use SSH to connect to other machines that do not have Ghostty's
terminfo entry, you will see error messages like missing or unsuitable terminal: xterm-ghostty, Error opening terminal: xterm-ghostty. or
WARNING: terminal is not fully functional.
Hopefully someday Ghostty will have terminfo entries pre-distributed everywhere, but in the meantime there are two ways to resolve the situation:
infocmp -x xterm-ghostty | ssh YOUR-SERVER -- tic -x -
# .ssh/config
Host example.com
SetEnv TERM=xterm-256color
Both variants can be automated by specifying one or both of the following in your Ghostty configuration:
shell-integration-features = ssh-terminfo to copy the terminfo entry the
first time you log into a new server over SSH.shell-integration-features = ssh-env to configure SSH to fall back to
xterm-256color.If both features are enabled
(shell-integration-features = ssh-terminfo,ssh-env), Ghostty will try to
install the terminfo entry first and use the fallback if installation failed.
See
shell-integration-features
for more about this configuration option.