There’s a new terminal on the block and its gaining a lot of momentum. Here’s why you should care.
Why another terminal?
The creator of Ghostty, Mitchell Hashimoto, talks about that on his own site here:
Talk: Introducing Ghostty and Some Useful Zig Patterns
Hello! I'm excited to talk today about Ghostty. Ghostty is a brand new terminal emulator written from scratch in Zig…mitchellh.com
Essentially, the state of terminal (emulators) today is a mess and you need to choose between fast, features, and native.
Ghostty aims to solve all three of those in one package.
There is a lot of excitement around this new terminal and not having to compromise on what you want out of it.
Built for Speed
Like I mentioned above, one of the key tenants for Ghostty is to make it fast.
- Developed in Zig
— low level programming language that is known for performance
The performance test I used is one Mitchell suggested using DOOM-fire-zig
GitHub - const-void/DOOM-fire-zig: DOOM's fire algo, in zig, for 256 color terminals w/no…
DOOM's fire algo, in zig, for 256 color terminals w/no dependencies - const-void/DOOM-fire-ziggithub.com
In Kitty, I got around 370 fps.
In Ghostty, I got around 470 fps.
So Ghostty is indeed more performant than Kitty.
A platform for extension
One of the future goals of Ghostty is to be a modern platform for text application development.
Some of the things I noticed as I have configured Ghostty on my M1 Mac:
- config not as straight forward as WezTerm, which uses Lua but is similar to what you know if you use Kitty
- ability to add features like bloom for text is pretty sweet (credit: Qwerasd)
- built in support for Kitty graphics protocol and a terminal visualizer to see memory usage and performance (open with cmd+alt+i
)
This level of tooling will make it easier for developers to add functionality and to debug and understand performance issues.
Configuration
Configuration is similar to what you do with Kitty in having a ghostty.conf file under your XDG_CONFIG directory. This is typically under ~/.config/
. For me my file is ~/.config/ghostty/config
Simply hit ctrl+,
to open up your config, save it, then reload with cmd+shift+,
Here is the default from the Github page, and you can see how you can set the font-family, configure a palette and set some keybinds.
# The syntax is "key = value". The whitespace around the equals doesn't matter.
background = 282c34
foreground= ffffff
# Comments start with a `#` and are only valid on their own line.
# Blank lines are ignored!
keybind = ctrl+z=close_surface
keybind = ctrl+d=new_split:right
# Empty values reset the configuration to the default value
font-family =
# Colors can be changed by setting the 16 colors of `palette`, which each color
# being defined as regular and bold.
#
# black
palette = 0=#1d2021
palette = 8=#7c6f64
# red
palette = 1=#cc241d
palette = 9=#fb4934
# green
palette = 2=#98971a
palette = 10=#b8bb26
# yellow
palette = 3=#d79921
palette = 11=#fabd2f
# blue
palette = 4=#458588
palette = 12=#83a598
# purple
palette = 5=#b16286
palette = 13=#d3869b
# aqua
palette = 6=#689d6a
palette = 14=#8ec07c
# white
palette = 7=#a89984
palette = 15=#fbf1c7
What is different though, is all the command line features to be able to understand the configuration.
List Themes
ghostty +list-themes
Pro Tip: combine with other command line tools like `fzf` or `grep` to make this quickly searchable.
ghostty +list-themes | fzf
Ghostty comes with all the iterm2-color-schemes so there are a LOT out of the box to choose from.
Iterm Themes - Color Schemes and Themes for Iterm2
Iterm2-color-schemes : A set of iTerm 2 color schemes/themes. Some schemes have been ported from Mac OSX's Terminal…iterm2colorschemes.com
List Keybinds
Want to see what your keybinds? Theres a CLI command for that!
ghostty +list-keybinds
You will see the built in keybinds like the one to reload your configuration, as well as all the custom keybinds you have configured yourself.
List Version
Always a handy command to see what version you are using
ghostty +version
I ended up customizing my config to remove the title bar and hide the mouse when typing and adjust the opacity as well as setting a few custom keybinds that work well with tmux.
Check out my config here:
dotfiles/ghostty.conf at main · exosyphon/dotfiles
Contribute to exosyphon/dotfiles development by creating an account on GitHub.github.com
Check out all other configs using this link:
Build software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to…github.com
Native
Ghostty uses native elements for the GUI so that it works great across many platforms.
For MacOS, it uses AppKit. For Linux, it uses GTK. Which is pretty smart.
For rendering it uses GPU rendering. For MacOS, it uses Metal and for Linux it uses OpenGL.
When can I get access?!?!
Currently in an invite only limited beta. The plan is for Ghostty to be free and open source and released sometime in 2024.
Until then you could pester someone in the limited beta and ask for access to the discord server. Mitchell has said he will immediately invite anyone who maintains TUIs, has Zig expertise, or has GTK or other native UI experience.
Conclusion
I am just getting into Ghostty and configuring it to my liking but it has been good so far. I am not able to get a couple keybinds (cmd+1, cmd+2, etc.) to behave as I like but hopefully that is just from me not having the syntax correct. Check out this video from Mitchell if you want even more information about Ghostty and how it was developed in Zig.
If you enjoy topics like this then you might also like my Youtube channel. Have a great day!