Open SourceDeveloper Tools

Terminal Borders That Don’t Cost a Cell: A Protocol Proposal

Box-drawing characters have been eating developer screen real estate since the VT-100. Every panel in a TUI app costs one row top, one row bottom, one column left, one column right. Nest a few panels on a 200×50 terminal and you’ve surrendered 10 rows to decorative lines — 20% of vertical screen space gone to Unicode glyphs that also corrupt your clipboard and break if the font doesn’t support them. Ratatui maintainer Josh McKinney just published a protocol proposal that makes borders a cell attribute instead of a character. The Ghostty patch is live. The proposal is open for feedback. The TUI ecosystem is paying attention.

What the Protocol Actually Does

The core idea: instead of placing a box-drawing glyph in a cell to represent a border, you attach border metadata to the cell edge. Each cell gets a 16-bit border ID pointing into a shared border table. No border? ID stays zero, overhead stays zero. Border present? The ID references a ~100-byte entry defining up to 12 line segments — two halves of each edge plus four arms from the center. The table caps at 65,535 unique border definitions, costing roughly 10–15 MB at maximum utilization. That ceiling will never be reached in practice.

The protocol uses DCS (Device Control String) sequences — the same mechanism xterm has used for capability negotiation since the 1970s. A basic blue underline looks like this:

ESC P 1 + b cell-border;pen;48;32;7aa2f7;0;0 ESC \
hello
ESC [ 0 m

Supported line styles: solid, double, dashed, dotted. Corners: square or rounded with configurable radius and anti-aliased arcs. Each segment carries independent color, width, and placement. When two neighboring cells disagree on a shared edge, the protocol resolves by priority, then width, then position. Text runs flush to the border edge. Copy-paste skips borders entirely because they are attributes, not characters.

What You Can Try Today

This is not theoretical. McKinney shipped a full Ghostty implementation spanning roughly 1,650 lines of code including tests, available on the joshka/cell-borders branch of the Ghostty repository. Build requirements: Zig 0.17 and Xcode. An earlier proof-of-concept also landed in Rio terminal PR #1947. On the Ratatui side, two working demos are available: a tiling pane layout you drag with the mouse, and a btop-style system monitor showing live CPU, memory, network, and process data. Both let you toggle between cell borders and box-drawing characters with the b key to see the difference immediately. The Ratatui demos require Rust 1.95+ due to a sysinfo dependency. The full specification and rationale are on McKinney’s site.

The Fragmentation Concern Is Real

The Lobsters thread hit 50+ comments quickly, and the sharpest criticism is this: Ghostty has become the terminal equivalent of a browser engine — drafting standards unilaterally before the broader ecosystem weighs in. If this protocol wins, TUI apps that adopt cell borders will eventually require a cell-border-aware terminal. Apps targeting tmux, screen, or older xterm builds fall back to box characters.

The fallback mechanism is technically solid. Applications query terminal support via DA1 capability exchange; unsupported terminals respond without the cell-border identifier, and the application falls back gracefully. Users on Ghostty or Rio see clean, space-efficient borders. Everyone else sees the box-drawing characters they always have. That is exactly how the Kitty Graphics Protocol rolled out — years of “only works in Kitty” before WezTerm, Ghostty, Foot, and others caught up. Synchronized Updates followed the same path. Neither fragmentation phase killed those proposals. They just took time.

Why the Timing Works

Ratatui now registers nearly 10 million monthly downloads and is listed as a dependency in over 6,700 crates. Netflix, OpenAI, AWS, Vercel, and Hugging Face use it. Ghostty shipped v1.4 in late October. lazygit, k9s, btop, and Helix have collectively normalized the idea that terminal applications are first-class developer tools, not fallback UIs for when a GUI is unavailable. The cell borders protocol has a natural distribution path: if any major application ships with it enabled, awareness spreads to millions of developers quickly. McKinney is explicitly asking terminal authors and TUI developers to comment on the Ghostty discussion thread regarding implementation cost and widget requirements. The proposal is a draft. This is the right moment to influence it.

If you build TUI applications, the demos are worth running. If you maintain a terminal emulator, the specification is worth reading. The adoption path runs through the people who ship production TUI tools — which is exactly who is being asked to weigh in.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:Open Source