{
  "id": 19988497,
  "title": "Terminal borders that don't cost a cell",
  "url": "https://urgent.news/2026/11/13/terminal-borders-that-dont-cost-a-cell-19988497",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-13T23:06:40.000Z",
  "source": {
    "name": "Hacker News Best",
    "slug": "hacker-news-best",
    "url": "https://www.joshka.net/cell-borders/"
  },
  "original_language": "en",
  "account": "This article discusses the limitations of using box-drawing characters for terminal borders and presents an alternative solution using a terminal protocol that draws thin lines on cell edges. The author, who has experience with terminal user interfaces (TUIs), has found that traditional box-drawing characters take up space and hinder proper design, leading to wasted rows and columns on the terminal screen.\n\nThe proposed solution involves storing cell borders as cell attributes, similar to background colors. Each cell can carry up to twelve line segments, including the two halves of each edge and four arms from the center. These segments can have their own color, width, placement, and style, allowing for more flexibility and control over the appearance of borders.\n\nSome advantages of this approach include:\n- Borders do not take up extra rows or columns, preserving screen real estate.\n- Underlining text fields and outlining buttons becomes easier without requiring additional padding.\n- Rounded corners can have a distinct outside color, maintaining visual consistency with the panel's background.\n- Lines can be solid, double, dashed, or dotted, providing greater visual variety.\n- Cell borders are stored within the cells themselves, allowing them to scroll, erase, insert, and reflow seamlessly alongside the text.\n- When neighboring cells share an edge, they can merge their borders, simplifying the rendering process.\n\nThe author has implemented this idea in a patch for Ghostty and demonstrated its effectiveness with demo applications built using Ratatui. The proposed terminal protocol could have benefits for charting tools, such as btop-style braille graphs, which currently require giving up rows for gridlines and averages. With cell borders, these gridlines can sit on cell edges between the dots, preserving the available screen space.\n\nThe approach also addresses copy and paste behavior, as cell borders are cell attributes and do not get copied along with the text. This eliminates the usual cleanup dance when pasting terminal content into other applications.\n\nOverall, the author believes that using cell borders instead of box-drawing characters offers a more efficient and visually appealing way to create aesthetically pleasing terminal interfaces without sacrificing functionality or screen space.",
  "summary": "Article URL: https://www.joshka.net/cell-borders/ Comments URL: https://news.ycombinator.com/item?id=50491423 Points: 324 # Comments: 141",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}