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

Configure Feed

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

🧪 test(term): first caret declaration wins when multiple present

+15
+15
test/term.test.ts
··· 352 352 expect(ansi).toMatch(/\x1b\[1;3H\x1b\[\?25h$/); 353 353 }); 354 354 355 + it("uses the first caret declaration when multiple are present", () => { 356 + let ansi = decode( 357 + term.render([ 358 + open("root", { 359 + layout: { width: grow(), height: grow(), direction: "ttb" }, 360 + }), 361 + text("AA", { caret: 1 }), 362 + text("BB", { caret: 2 }), 363 + close(), 364 + ]).output, 365 + ); 366 + // First caret: offset 1 of "AA" → column 2, row 1. 367 + expect(ansi).toMatch(/\x1b\[1;2H\x1b\[\?25h$/); 368 + }); 369 + 355 370 it("accounts for wide characters when positioning the caret", () => { 356 371 let ansi = decode( 357 372 term.render([