Terminfo
Terminfo is used to tell software about the terminal's capabilities. Ghostty ships with its own terminfo entry to advertise its features.
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.
Note
Why the
xtermprefix? Unfortunately, many terminal applications string search for "xterm" in theTERMvalue to assume capabilities. During the private beta, we experimented with a pureghosttyvalue, but found that too many applications broke and fixing the entire ecosystem was unrealistic. We settled onxterm-ghosttyto maintain compatibility.
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.
Important
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 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:
- Copy Ghostty's terminfo entry to the remote machine. The easiest way is using
the following one-liner:
infocmp -x xterm-ghostty | ssh YOUR-SERVER -- tic -x - - Configure SSH to fall back to a known terminfo entry using the following SSH
configuration (requires OpenSSH 8.7
or newer):
# .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-terminfoto copy the terminfo entry the first time you log into a new server over SSH.shell-integration-features = ssh-envto configure SSH to fall back toxterm-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.
Note
The
ticcommand on the server may give the warning"<stdin>", line 2, col 31, terminal 'xterm-ghostty': older tic versions may treat the description field as an aliaswhich can be safely ignored.
Note
ticwill normally place its results in the system database,/usr/share/terminfo. This location can be overridden with theTERMINFOenvironment variable. IfTERMINFOis not set andticcannot write to the system location, it will place the results in$HOME/.terminfoif it exists.man ticfor details.
Note
macOS versions before Sonoma cannot use the system-bundled
infocmp. The bundled version ofncursesis too old to emit a terminfo entry that can be read by more recent versions oftic, and the command will fail with a bunch ofIllegal charactermessages. You can fix this by using Homebrew to install a recent version ofncurseswithbrew install ncursesand replacinginfocmpabove with the full path/opt/homebrew/opt/ncurses/bin/infocmpor/usr/local/opt/ncurses/bin/infocmp.
Warning
Fallback does not support advanced terminal features. Because
xterm-256colordoes not include all of Ghostty's capabilities, terminal features beyond xterm's like colored and styled underlines will not work.