[READ-ONLY] Mirror of https://github.com/bombshell-dev/tty. Platform independent 2D layout engine for terminal applications based on Clay
5

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ› preserve parent background when text bg is default

In setcell(), skip overwriting bg when the incoming value is
ATTR_DEFAULT so that backgrounds painted by render_rect() flow
through to text cells.

Fixes #1

Charles Lowell (Mar 25, 2026, 4:29 PM -0500) e7c3807f 892efe09

+19 -1
+3 -1
src/clayterm.c
··· 73 73 Cell *c = cell_at(ct, ct->back, x, y); 74 74 c->ch = ch; 75 75 c->fg = fg; 76 - c->bg = bg; 76 + if (!(bg & ATTR_DEFAULT)) { 77 + c->bg = bg; 78 + } 77 79 } 78 80 79 81 /* โ”€โ”€ Escape sequence generation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */
+16
test/term.test.ts
··· 28 28 expect(out).toContain("Hello, World!"); 29 29 }); 30 30 31 + it("text inherits parent background", () => { 32 + let ansi = decode(term.render([ 33 + open("root", { 34 + layout: { width: grow(), height: grow(), direction: "ttb" }, 35 + bg: rgba(255, 0, 0), 36 + }), 37 + text("hi"), 38 + close(), 39 + ])); 40 + 41 + // the SGR active when "h" is emitted should include the 42 + // parent's red background (48;2;255;0;0), not terminal default 43 + let before = ansi.slice(0, ansi.indexOf("h")); 44 + expect(before).toContain("\x1b[48;2;255;0;0"); 45 + }); 46 + 31 47 it("renders borders and padding", () => { 32 48 let out = print( 33 49 decode(term.render([