The freshly made public Ghostty terminal emulator by Mitchell Hashimoto (co-founder of Hashicorp) is all the rage at the moment, and it definitely looks interesting:
I decided to give it a spin on my Macbook, and see if it offers any improvements over Wezterm, which is my current terminal emulator of choice.
So far so good, it seems to work very well and offers quite a few customization options.
Tip
Also worth noting is ghostty.zerebos.com that offers a Ghostty config tool.
The first real issue I had with it, was when using SSH to connect to remote resources. This produced the missing or unsuitable terminal: xterm-ghostty
error message, because the remote resource doesn’t have the xterm-ghostty
terminfo defined. The official Ghostty docs has some workarounds for it, but these are either to convoluted like copying terminfo entries to all remote systems, or setting SetEnv TERM=xterm-256color
in .ssh/config
for each remote host. The other alternative is to set SetEnv TERM=xterm-256color
system wide but that also affects other terminal emulators (as does setting it in .ssh/config
)
Workaround #
My workaround for it, is to set the TERM variable in my .zsrc
file, but only if Ghostty is the terminal emulator in use (as Wezterm doesn’t have this issue). This way I don’t have to do it for every remote host, or copy terminfo for Ghostty to them.
This is simple do to, as the $TERM_PROGRAM
variable contains the name of the emulator currently in use. Add the following to your .zsrc
file, and the TERM=xterm-256color
variable declaration is only done when .zsrc
is processed in Ghostty and not in other terminal emulators.
if [[ "$TERM_PROGRAM" == "ghostty" ]]; then
export TERM=xterm-256color
fi
Related Posts
- Beware Of The Rogue VMs! — Published
- Rickrolling WiFi at VMware Explore Barcelona 2024 — Published
- GL-iNet Opal (GL-SFT1200) Travel Router: First Impressions — Published
- My Updated Pi-Hole Setup — Published
- VMware Explore 2024 Barcelona Content Catalog Is Now Live — Published