Terminal Emulator

Portty

A cross-platform, GPU-accelerated terminal emulator written in C — with pluggable backends for rendering, windowing, and fonts.

#c #freetype #harfbuzz #sdl3 #terminal-emulator #lottie-animation #gpu

What is Portty?

Portty is a modern terminal emulator built in C around a modular backend architecture. It separates terminal emulation, rendering, platform windowing, and font handling into four swappable interfaces, so each layer can be replaced without touching the others. The terminal engine itself is coffer, a zero-dependency virtual terminal in C.

It ships today with coffer for terminal emulation, SDL3 for the GPU renderer and platform, and FreeType/HarfBuzz for text shaping. The renderer uses the SDL3 GPU backend (Vulkan, D3D12, or Metal) — not OpenGL — for gamma-correct, hardware-accelerated text.

Features

  • GPU-accelerated, damage-driven rendering via SDL3 (Vulkan / D3D12 / Metal) — an idle terminal does no rendering work
  • Gamma-correct text: glyph coverage is composited in linear light and re-encoded to sRGB once, tunable with text_composition_strategy
  • Pluggable backends: platform + rendering, terminal, font, font resolver
  • Sixel graphics, iTerm2 inline images, and kitty graphics share one image cache and compositing path, alongside Lottie animations
  • Kitty keyboard protocol, OSC 52 clipboard write, OSC 8 hyperlinks (Ctrl+click, with a scheme allow-list), OSC 7 working directory, and OSC 10/11 color queries
  • Color fonts and fallback: COLR v1 paint graphs, variable fonts, coverage-aware emoji routing, Nerd Fonts v2→v3 translation, and procedural box drawing
  • FreeType + HarfBuzz text shaping, plus underline styles (single, double, curly, dotted, dashed), overline, and strikethrough
  • HiDPI-aware: fonts re-rasterize and the grid re-derives when the window moves to a display with another scale factor
  • Terminal reset: Ctrl+Delete clears a stuck keyboard or mouse mode, Ctrl+Shift+F8 does a full reset, and portty pops a dead program’s kitty keyboard flags on its own
  • Built-in diagnostics report (Ctrl+Shift+F6) in an internal pager: build, GPU and driver, fonts, effective config, and session state
  • Status panels and overlays: bell, resize geometry, and notifications; Ctrl+Shift+N opens a new window in the shell’s working directory
  • Scripting for debugging and regression tests: portty --script drives the terminal, waits for output, asserts on the grid, and captures screenshots
  • Native builds on Linux, macOS (Core Text + Metal), and Windows (ConPTY + DWM); portable ZIPs for macOS and Windows
  • Emacs integration, a custom portty-vty-256color terminfo entry, and a hardened heap allocator under debug/ASan

Build & install

macOS (Apple Silicon) and Windows (x86_64): download the portable ZIP from the releases page. Linux: build from a checkout of the repo:

git clone https://github.com/chestso/portty
cd portty
./autogen.sh
mkdir -p build && cd build
../configure --prefix=$HOME/.local
make -j"$(nproc)"
make install

Platform notes

  • Linux — SDL3 + Fontconfig font resolver
  • macOS — Core Text font resolver, Metal backend
  • Windows — ConPTY, native font resolver, DWM styling; portty.exe is a console binary (so it pipes) and porttyw.exe a GUI launcher. Builds with MSYS2/UCRT64. OSC 5555 carries kitty graphics and Lottie, since ConPTY drops APC sequences