···432432 expect(ansi).not.toContain("\x1b[?25l");
433433 });
434434435435+ it("shows the cursor at the text origin when content is empty and caret is 0", () => {
436436+ // v1 known limitation: Clay does not emit a text render command for an
437437+ // empty string, so locate_caret never finds a matching slice and suppresses
438438+ // cursor visibility. The proper fix requires looking up the element's
439439+ // bounding box separately (e.g. via get_element_bounds) rather than
440440+ // scanning text render commands. Until that is implemented, no cursor
441441+ // appears when the caret-bearing text node is empty.
442442+ let ansi = decode(
443443+ term.render([
444444+ open("root", {
445445+ layout: { width: grow(), height: grow(), direction: "ttb" },
446446+ }),
447447+ text("", { caret: 0 }),
448448+ close(),
449449+ ]).output,
450450+ );
451451+ expect(ansi).not.toContain("\x1b[?25h");
452452+ expect(ansi).not.toContain("\x1b[?25l");
453453+ });
454454+435455 it("hides the cursor when transitioning from caret-present to caret-absent", () => {
436456 // First frame: caret declared.
437457 term.render([