chore(vendor): import pi 1.3.0

Imported as a linear vendor commit so forge rebases do not replay the upstream root tree.

git-subtree-dir: third_party/pi

git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
alexion committed 2026-10-15 17:58:48 -04:00
1 parent 719370c8f7
commit 6081e3e325
1743 files changed
+205459 -131704

No files matched your search

@@ -22,6 +22,20 @@ class StaticOverlay implements Component {
invalidate(): void {}
}
class CursorTrackingTerminal extends VirtualTerminal {
cursorVisible = true;
override hideCursor(): void {
this.cursorVisible = false;
super.hideCursor();
}
override showCursor(): void {
this.cursorVisible = true;
super.showCursor();
}
}
class EmptyContent implements Component {
render(): string[] {
return [];
@@ -538,4 +552,31 @@ describe("TUI overlay options", () => {
tui.stop();
});
});
// https://github.com/earendil-works/pi/issues/10026
describe("hiding after stop", () => {
it("hideOverlay() leaves the cursor visible", () => {
const terminal = new CursorTrackingTerminal(80, 24);
const tui: TUI = new TuiMainScreen(terminal);
tui.start();
tui.showOverlay(new StaticOverlay(["OVERLAY"]), { nonCapturing: true });
tui.stop();
tui.hideOverlay();
assert.strictEqual(terminal.cursorVisible, true);
});
it("overlay handle hide() leaves the cursor visible", () => {
const terminal = new CursorTrackingTerminal(80, 24);
const tui: TUI = new TuiMainScreen(terminal);
tui.start();
const handle = tui.showOverlay(new StaticOverlay(["OVERLAY"]), { nonCapturing: true });
tui.stop();
handle.hide();
assert.strictEqual(terminal.cursorVisible, true);
});
});
});