[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.

test: failing repro for targeted-sgr-resets

Nate Moore (Jun 4, 2026, 12:51 AM -0500) 4bb6bb84 d75fb4b6

+28
+28
test/targeted-sgr-resets.test.ts
··· 1 + import { describe, expect, it } from "./suite.ts"; 2 + import { createTerm } from "../term.ts"; 3 + import { close, grow, open, rgba, text } from "../ops.ts"; 4 + 5 + const decode = (b: Uint8Array) => new TextDecoder().decode(b); 6 + 7 + describe("targeted SGR resets", () => { 8 + it("leaving a background run emits a targeted bg reset", async () => { 9 + let term = await createTerm({ width: 6, height: 2 }); 10 + let ansi = decode( 11 + term.render([ 12 + open("root", { 13 + layout: { width: grow(), height: grow(), direction: "ttb" }, 14 + }), 15 + open("a", { layout: { width: grow() }, bg: rgba(255, 0, 0) }), 16 + text("A"), 17 + close(), 18 + open("b", { layout: { width: grow() } }), 19 + text("B"), 20 + close(), 21 + close(), 22 + ]).output, 23 + ); 24 + 25 + // pins: ending a bg run uses \x1b[49m (bg-default), not a blanket \x1b[0m 26 + expect(ansi).toContain("\x1b[49m"); 27 + }); 28 + });