feat(web): render terminals with libghostty-vt (#4860)

Co-authored-by: Claude Fable 5 <[email protected]>
This commit is contained in:
Wout StiensandClaude Fable 5 authored and GitHub committed 2026-07-31 13:15:25 +02:00
1 parent ab8182cb4e
commit acf761b2f5
28 files changed
+5217 -518

No files matched your search

@@ -2,8 +2,10 @@ import { describe, expect, it } from "vite-plus/test";
import {
resolveTerminalSelectionActionPosition,
shouldHandleTerminalExit,
shouldHandleTerminalSelectionMouseUp,
terminalSelectionActionDelayForClickCount,
terminalSelectionLineRange,
} from "./ThreadTerminalDrawer";
describe("resolveTerminalSelectionActionPosition", () => {
@@ -72,4 +74,19 @@ describe("resolveTerminalSelectionActionPosition", () => {
expect(shouldHandleTerminalSelectionMouseUp(false, 0)).toBe(false);
expect(shouldHandleTerminalSelectionMouseUp(true, 1)).toBe(false);
});
it("uses Ghostty's physical screen range for visually wrapped selections", () => {
expect(
terminalSelectionLineRange({
start: { y: 4 },
end: { y: 6 },
}),
).toEqual({ lineStart: 5, lineEnd: 7 });
});
it("handles an exit that lands while the terminal surface is still loading", () => {
expect(shouldHandleTerminalExit("exited", "running", false)).toBe(true);
expect(shouldHandleTerminalExit("exited", "exited", false)).toBe(false);
expect(shouldHandleTerminalExit("closed", "running", true)).toBe(false);
});
});