Share: Facebook icon- LinkedIn icon

:printer:

Ghostty - first impressions and Emacs-like split panes how-to

Published Thu Jan 02 2025

Tags: cli linux macos ramblings


It seems like all content creators in the Linux space are covering Ghostty these days, so I decided to jump on the bandwagon. This post will be short and sweet ramblings based upon my first impressions. If you want a TheMKat flavored Ghostty post, read on.

What is this Ghostty you speak of?

Ghostty is yet another terminal emulator. Wait… Don't leave! While that sounds incredibly dull when you say it out loud, it is worth looking into. Features include hardware acceleration (GPU) for rendering, as well as using native UI elements (e.g, file menus). To me, some other features worth pointing out are:

  • Reasonable resource usage. Like Alacritty (which has some commonalities), it is quite minimal and lightweight w.r.t resource usage.
  • Dead-simple configuration. The configuration is easy to read, easy to understand, and do what is expected. Many other terminal emulators either have a GUI driven way of doing configurations (like iTerm2) or do not support sequences of bindings like Emacs (e.g, Alacritty if I'm not too stupid to find it).
  • Key-bindings actually support sequences!!!(!!!!!!!) This is incredible to me, as I use Emacs btw. I love using sequences of keys like ctrl x 2 M-x 3 to do stuff that give other people the ick. Ghostty supports this, so I can use ctrl-x 2 to split my windows into multiple terminals (yes, just like Emacs! weee).
  • Friendly to those people who prefer graphical gizmos. You can do most operations from the GUI, except the terminal commands themselves (duh!). While this is not me, I think having a diverse user base is a net positive.
  • It being a Zig codebase. Probably not important to most of you, but I think it is awesome that there is a Zig project getting this much coverage! Zig is a cool programming language that has some really neat ideas (e.g, sending allocator objects as parameters where you need memory allocation. Makes for really flexible use cases in different platforms. Maybe you want to use the standard heap allocator one place, and maybe an arena allocator with a pre-defined memory area for another place? Or make your own custom weird allocator? Anyway, these parenthesis is getting too long with me just mentioning how cool Zig is. You should probably check out Zig if you have not tried it already! And no, my favorite language these days is still Rust :smile: )

Configuration

You are reading my blog for some reason, and not the official docs, so my guess is that you want to hear about my configuration. Reading other peoples configurations is what usually helps me when experimenting with new applications like this.

Theme

While I'm not super-pleased with it yet, I made a quick theme based upon my pink-bliss-uwu theme for Emacs (which is based upon the earlier pink-bliss theme by someone else).

background = ffe4e1
foreground = 8b008b
cursor-color = ffc0cb
selection-background = ffc0cb
selection-foreground = 942092

It ends up looking like the following:

Ghostty with a taste of pink bliss UwU

Emacs like window splitting and Windmove-like navigation

In Ghostty we use the keybind configuration item to create keybindings. As Ghostty supports sequences, we can easily make C-x 2 and the rest of the window splitting work like in Emacs. We simply use + to combine keys, and > to mark the separation of each part of the sequence. ctrl+x>2 would therefore be the same as the C-x 2 notation that Emacs users are familiar with. Window splitting horizontally and vertically, with Windmove navigation, would therefore translate to:

keybind = ctrl+x>2=new_split:right
keybind = ctrl+x>3=new_split:up
keybind = super+left=goto_split:left
keybind = super+right=goto_split:right
keybind = super+up=goto_split:top
keybind = super+down=goto_split:bottom

This ends up behaving like the following:

Ghostty with Emacs like splits

The sudden right-up movement instead if straight up might be a bug. Unsure, as I'm in the process of tweaking and testing many weird configuration options at the moment :smile:

The rest of the configuration

My current configuration with comments is found below:

# getting a blocky cursor instead of the simple dash
adjust-cursor-thickness=5000%

window-theme = light
# The theme pasted above
theme = /Users/marie/pink-bliss-ghost

# Use a cutesy font
font-family = Monaspace Radon Var

unfocused-split-opacity = 0.35
unfocused-split-fill = ffc0cb

mouse-hide-while-typing = true

window-padding-x = 50
window-padding-y = 50

# Emacs like splits and Windmove navigation
keybind = ctrl+x>2=new_split:right
keybind = ctrl+x>3=new_split:up
keybind = super+left=goto_split:left
keybind = super+right=goto_split:right
keybind = super+up=goto_split:top
keybind = super+down=goto_split:bottom

keybind = alt+up=scroll_page_lines:-2
keybind = alt+down=scroll_page_lines:2

keybind = super+shift+left=previous_tab
keybind = super+shift+right=next_tab

keybind = super+r=reload_config

Have you tried Ghostty? Feel free to share your initial ramblings in the comments :smile:




Other posts that might interest you: