NewsCrawler.org

Terminal borders that don't cost a cell

Terminal borders that don't cost a cell
Image: joshka.net

The author, who maintains Ratatui, describes a terminal protocol that draws thin lines on the edges of character cells instead of using box-drawing characters. Such borders take no row or column, while box-drawing characters fill a whole cell and take space from the content of TUI[1] apps. The author has a working patch for Ghostty, an earlier version for Rio and demo apps built with Ratatui, and asks terminal and TUI authors for feedback.

Each cell can carry up to twelve line segments, each with its own color, width, placement and style. Lines can be solid, double, dashed or dotted, and when two neighboring cells share an edge, the line with the higher priority wins. The protocol is sent as one DCS[2] string; an app first sends a capability query followed by DA1[3]. If the reply to the border query does not arrive before the DA1 reply, the app falls back to box-drawing characters.

The author calls the spec version 1, but says it is a draft, closer to v0.1, and not a stable standard.

Read the original joshka.netDiscussion

Discussion

Commenters mostly question the approach: several say cell borders break copy and paste or lose meaning that box characters keep, and one worries that TUI apps will come to depend on Ghostty. Others point to the existing overstrike mode (DECSET 20), supported by mintty, or ask why the design is not more ambitious. Some find the borders too tight against the text.

Sources

Published: First seen: Читать по-русски

Open as a page