Ghost in the Terminal

The best terminal you aren't using, but should be

Too Many Options

Throughout my years Iā€™ve tried many different terminals across many different operating systems. Ranging from Windows Terminal, iTerm2, Alacritty, Foot, Gnomeā€™s Console, and Wezterm, as well as others that arenā€™t remarkable enough to be mentioned in my opinion. In the end it was one terminal that stole my heart, Ghostty. I should note that Ghostty is currently in closed beta however. Anyway, letā€™s talk about why I love this terminal so much, and why you should try it.

My Favorite Features

One of the best features of Ghostty has to be the amount of features it has. It probably has the most features and flexibility of any terminal Iā€™ve used in the past. Iā€™ll give a short overview of my favorite features but there is really so many that I donā€™t feel like Iā€™d do it justice trying to explain them all.

Simple Configuration

screenshot of the terminalā€™s config format

One thing I really like is how simple the configuration format for Ghostty is, itā€™s extremely simple, and while it may look somewhat like INI or TOML, it is not either of them. The configuration format for Ghostty does not have sections or tables or arrays or anything else the other formats have. Itā€™s just a simple key-value format. For keys that can take multiple values, you simply repeat the key, itā€™s that simple! Some people may prefer more sophisticated formats like TOML, INI, or even YAML (ew) or JSON (more ew), however I personally think the configuration format is perfect as it is.

Splitting the Terminal

screenshot showing the split terminal panes

One of the biggest reasons I used to use terminal multiplexers such as tmux and zellij was to be able to split my terminal into ā€œpanesā€, having multiple things on the same tab or terminal window. With Ghostty however, using multiplexers for this purpose is fairly redundant as Ghostty natively supports splitting terminal views into multiple panes. At this point I only really use a multiplexer for allowing others to see my terminal on remote servers and run things in the background with easy access.

Native System Tabs

screenshot showing the ā€œall tabsā€ view

Since Ghostty uses native tabs from system libraries such as GTK and UIKit, we get features baked into the interface that come with using those libraries. For example the view you see above comes from macOSā€™ native UIKit library and its tab component. This is not something you can easily get when using custom or third party components, while as using the native libraries comes with it free.

Built-in Nerd Fonts

screenshot showing nerd fonts in action

One thing Iā€™ve always loathed with other terminals is getting powerline and nerd fonts setup so that my prompts or neovim configuration shows up with nice symbols and everything. With Ghostty however this isnā€™t really an issue as Ghostty embeds both nerd fonts and powerline fonts (as well as Jetbrains Mono as a default), giving it an amazing out of box experience, that honestly leaves me yearning for it when using other terminals, or integrated ones in apps such as Zed.

Custom Shaders

screenshot showing a custom CRT shader

This is really a niche feature but itā€™s honestly so fucking cool. You can specify custom GLSL shader files to change how the renderer does things. This allows for things like above, a CRT shader, allowing your terminal to look like an old CRT monitor! You can also do things like bloom and so so much more. I have not seen many terminals which support the use of custom shaders, and itā€™s really cool.

KiTTY Image Protocol

screenshot loading my wallpaper in Ghostty using icat

It should also be mentioned that Ghostty supports KiTTYā€™s image protocol, so you can load images in the terminal itself! No more do you need a seperate program to view images! Someone has even gotten DOOM playable in the terminal itself. Demonstrating not only Ghosttyā€™s flexibility but performance. From what I remember there is even some rudimentary Sixel support implemented, and while I could be wrong about that, I believe support is planned in the future.

So Much More

There are so many more features and settings you can change with Ghostty that Iā€™d be doing it injustice trying to explain them all (as I said previously). But these are some of my favorites. If you want to check all the features for yourself I highly recommend joining the Discord Server for it and waiting to be added to the beta, or eventually waiting for it to go open source, later this year as a matter of fact.

Amazing Performance

Before starting this section Iā€™m going to recommend you go read Mitchellā€™s blog posts on developing ghostty as they have a lot more metrics posted there, but I will post some highlights from the most recent devlog to share and boost it. You can check out Mitchellā€™s blog on Ghostty here.

Using cat to Read Large Files

As of the latest devlog Mitchell has posted Ghostty is the second fastest at reading large unicode files such as the entire japanese bible using cat, below you can see a table showing performance metrics displaying how fast each terminal was at displaying everything using the software.

TerminalVersionSpeed
Ghostty874c4e1373ms
Alacritty0.13.166ms
iTerm23.4.23470ms
KittySIMD Branch103ms
Kitty0.32.1392ms
Terminal.appmacOS 14.3124ms
WezTerm20240203-110809-5046fc22140ms

Optimized Grapheme Performance

Across Ghosttyā€™s development multiple methods of grapheme and unicode lookup were used, including wcwidth, ziglyph (a zig grapheme library), and finally a custom lookup table implementation. It was found in the end the custom implemenation was much faster than its competitors.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Benchmark 1: noop
  Time (mean Ā± Ļƒ):     127.9 ms Ā±   1.5 ms    [User: 115.8 ms, System: 10.3 ms]
  Range (min ā€¦ max):   126.5 ms ā€¦ 131.4 ms    23 runs

Benchmark 2: wcwidth
  Time (mean Ā± Ļƒ):     136.5 ms Ā±   1.9 ms    [User: 124.3 ms, System: 10.4 ms]
  Range (min ā€¦ max):   134.9 ms ā€¦ 143.0 ms    21 runs

Benchmark 3: ziglyph
  Time (mean Ā± Ļƒ):     620.5 ms Ā±   1.3 ms    [User: 610.5 ms, System: 9.8 ms]
  Range (min ā€¦ max):   619.0 ms ā€¦ 602.6 ms    10 runs

Benchmark 4: table
  Time (mean Ā± Ļƒ):     122.4 ms Ā±   2.4 ms    [User: 110.5 ms, System: 10.4 ms]
  Range (min ā€¦ max):   120.6 ms ā€¦ 132.4 ms    23 runs

Utilizing SIMD for Throughput

As you can see in the benchmarks below utilizing SIMD over scalars or memcpy resulted in performance 7.3x faster than the other options. This is a massive improvement and itā€™s quite amazing how this change drastically improved the throughput of the terminal when printing large text chunks.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Benchmark 1: memcpy
  Time (mean Ā± Ļƒ):      52.7 ms Ā±   0.7 ms    [User: 41.6 ms, System: 47.6 ms]
  Range (min ā€¦ max):    50.7 ms ā€¦  54.6 ms    53 runs

Benchmark 2: scalar
  Time (mean Ā± Ļƒ):     382.3 ms Ā±   4.0 ms    [User: 408.6 ms, System: 39.1 ms]
  Range (min ā€¦ max):   376.1 ms ā€¦ 388.7 ms    10 runs

Benchmark 3: simd (aarch64 neon)
  Time (mean Ā± Ļƒ):      52.3 ms Ā±   0.6 ms    [User: 53.8 ms, System: 47.2 ms]
  Range (min ā€¦ max):    51.3 ms ā€¦  54.2 ms    54 runs

For UTF-8 through UTF-32 it also drastically improved the performance by roughly 16x.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Benchmark 1: memcpy
  Time (mean Ā± Ļƒ):      22.3 ms Ā±   0.8 ms    [User: 11.5 ms, System: 31.4 ms]
  Range (min ā€¦ max):    20.2 ms ā€¦  25.5 ms    115 runs

Benchmark 2: scalar
  Time (mean Ā± Ļƒ):     344.1 ms Ā±   1.2 ms    [User: 344.4 ms, System: 38.3 ms]
  Range (min ā€¦ max):   341.9 ms ā€¦ 347.0 ms    10 runs

Benchmark 3: simd (aarch64 neon)
  Time (mean Ā± Ļƒ):      20.7 ms Ā±   0.8 ms    [User: 18.9 ms, System: 28.0 ms]
  Range (min ā€¦ max):    19.1 ms ā€¦  24.4 ms    127 runs

Footnotes About Benchmarks

All of these benchmarks were grabbed from Mitchellā€™s latest devlog as of writing this, I did not run these benchmarks myself, and honestly I do not have the knowledge even to comment fully on these besides ā€œwoah thatā€™s fast.ā€ So best to ask in the Ghostty server about these benchmarks so someone can actually answer them and give you proper answers to any questions. šŸ˜‰

My Final Words

Hopefully you enjoyed this little information dump about the terminal I have whole-heartedly fallen in love with. Iā€™ve been a moderator in the Discord for Ghostty since last year, and the community is also amazing on top of the terminal being amazing itself. If you want to give the terminal a try and get into the beta for early access, come join us! We donā€™t bite, I promise.