Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/e2e/terminal-keys.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,20 @@ for (const renderer of ["ghostty", "xterm"] as const) {
await expect.poll(() => sent(page)).toBe("\x1b[13;2u\x1bb\x1bf\x01\x05\x15\r");
});
}

// ghostty-web makes the terminal's host contenteditable and focuses it, so
// without caret-color the browser blinks its own caret, the canvas's height,
// at the left edge beside the terminal's cursor.
test("ghostty: a focused terminal shows no browser caret", async ({ app }) => {
mockOnly("the shell is on the mock's gpu box");
await app.open({ prefs: { terminal: { renderer: "ghostty" } } });
const page = app.page;
await openShell(page);
const caret = () =>
page.evaluate(() => {
const a = document.activeElement as HTMLElement | null;
const host = a?.closest<HTMLElement>("[contenteditable=true]");
return host ? getComputedStyle(host).caretColor : "no editable host";
});
await expect.poll(caret).toBe("rgba(0, 0, 0, 0)");
});
4 changes: 4 additions & 0 deletions app/src/lib/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@ async function createGhostty(host: HTMLElement, colors: TerminalColors, prefs: T
hung.stop();
delete (t as { focus?: unknown }).focus;
}
// open() makes the host contenteditable and focus() focuses the host, so
// the browser blinked its own text caret there, as tall as the canvas, at
// the terminal's left edge. The terminal draws its own cursor.
host.style.caretColor = "transparent";
keepLastColumn(t);
oneReadPerFrame(t);
const frames = drawOnDemand(t, host, prefs.cursorBlink);
Expand Down
6 changes: 5 additions & 1 deletion docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ upgrades with `berth upgrade BOX`, or by running the
again.

## Unreleased

- **No more tall blinking bar at a terminal's left edge.** With the Ghostty
renderer, a focused terminal showed the browser's own text cursor down its
whole height, next to the terminal's real cursor. Only the real one shows
now.
- **A box newer than the app is no longer called outdated.** An older
Shipyard used to offer to update a box that already ran a newer release,
and *Update all* (or updating boxes automatically) would put its older
`berthd` on it. Now a newer box is left alone, and `berth upgrade` refuses
to downgrade one unless you pass `--force`. This works once both the app
and the box are on this release or later.


## v0.3.22

- **Mac terminal keys work in terminals.** ⇧↵ starts a new line in Claude
Expand Down
Loading