Ghostty Terminal Emulator
We ain’t afraid of no Ghostty 2024-12-18
Section titled “We ain’t afraid of no Ghostty 2024-12-18”Source: Changlog Interview Episode 622, We ain’t afraid of no Ghostty
Summary: Describes Ghostty, the terminal emulator, and it’s vision and terminal as a platform.
-
Side project motivations for Mitchell: desire to work on desktop, programming, GPU enabled
-
Idea: Terminals are conceptually like web browsers
- Web browser = mainstream GUI ecosystem
- There is a place for text based interfaces - terminal is the
platform
- Terminal could be an exciting if it gets more features
-
Terminal as a platform, terminal user interface (TUI)
- Ask users what draws them to use a non-terminal applications
- Examples:
- Drag and drop files
- Native tabs
- Use native file explorer
- Need browser, maybe TUI can have a browser widget
- Examples:
- Ask users what draws them to use a non-terminal applications
Ghostty vision: best terminal emulator experience because
Section titled “Ghostty vision: best terminal emulator experience because”- Fast
- How fast text can go through terminal, example cat file, tail logs
- How fast key press to terminal feedback / display
- Frame rate, example scrolling
- Cross platform
- macOS: SwiftUI
- Metal
- Linux: GTK
- OpenGL
- Windows: in progress
- macOS: SwiftUI
- Native
- Instructions to make read/processing, rendering fast
- Features
- Ligature support
- Support modern terminal features in version 1.0
- Multiplexer support
- Issue: tmux can conflict with terminal’s graphics protocols
- Would be nice to have multiplexer features inside the terminal
itself
- Example: Host ghostty and connect in VPN like tailscale to other machines with sessions saved with terminal
- Can reuse libghostty as UI integration, core
- Look to cross platform web browsers for good features
- Quick terminal (drop down terminal)
- Terminal inspector
- Will help people debug terminal applications
Discussion
Section titled “Discussion”- Discord and GitHub is active for a young project
- Insight is many young people are interested in terminal
- Project is discussing governance, project sustainability, financing (pay infrastructure, contributors)
- Why Zig language?
- Low level systems languages like C
- Personal choice, had thought about rust
- Community
- No garbage collector
- Zig contributions
- Compiler contributions
- Zig real world use case
- Low level systems languages like C
- Hard stuff?
- Font rendering
- Config
- Config file naming and CLI argument keys are same names
- File format is fast to parse
- Constraints in software can be good
- Defaults:
- Font: Jetbrains Mono with emojis packaged
- Config file naming and CLI argument keys are same names
Install on Ubuntu Linux
Section titled “Install on Ubuntu Linux”Arch Linux Distrobox as of 2025-01-11
Section titled “Arch Linux Distrobox as of 2025-01-11”- Use Distrobox and podman
- Use archlinux:latest image from docker.io
- Install ghostty with pacman
- Expose ghostty to host
sudo apt-get updatesudo apt-get -y install podman
# Set up distrobox for running ghostty# Specify container repositorydistrobox create -n arch --image docker.io/archlinux:latestdistrobox enter arch
sudo pacman -Syu ghostty --noconfirm
# Export ghostty for use on hostdistrobox-export --app ghostty# Exit container and run ghosttyWhen running ghostty inside the container, it will only have access to user’s programs local those in .local/bin and nix, but not those installed on host like apt programs.
Build from source using Nix as of 2024-12-28
Section titled “Build from source using Nix as of 2024-12-28”-
Nix-shell
Terminal window nix-shell# Build binary to $HOME/.local/binzig build -p $HOME/.local -Doptimize=ReleaseFast# Logout, then launch ghostty from app launcher## Uninstall ghostty from zig build aboverm -rf $HOME/.local/bin/ghosttyrm -rf $HOME/.local/share/ghosttyrm -rf $HOME/.local/state/ghosttyrm -rf $HOME/.local/share/man/man1/ghostty.1rm -rf $HOME/.local/share/man/man5/ghostty.5rm -rf $HOME/.local/share/terminfo/ghostty.*## Reboot or logout -
Nix only (has issues)
Terminal window git clone https://github.com/ghostty-org/ghostty.gitcd ghostty# Build using nix and enable experimental featuresnix build .#ghostty --extra-experimental-features 'nix-command flakes'## Agree to prompts# Run ghostty./result/bin/ghostty# If EGL problems, use nixGL - required for non-NixOS Ghostty# or home-manager installed ghostty# per https://github.com/nix-community/nixGLnix run --impure github:nix-community/nixGL --extra-experimental-features 'nix-command flakes' -- ./result/bin/ghostty