Skip to content

Fix Esc leaving an empty New-tab page when the article tab is the last one - #28

Merged
Shaance merged 1 commit into
mainfrom
fix/esc-close-last-tab
Nov 5, 2026
Merged

Shaance merged 1 commit into
mainfrom
fix/esc-close-last-tab

Conversation

@Shaance

@Shaance Shaance commented Nov 5, 2026

Copy link
Copy Markdown
Owner

terminal-browser's control-socket close-tab never shuts the browser down — on the last tab it creates a fallback New-tab page, so the Ghostty pane lingered after Esc. close() now checks targets: other tabs present → close only the owned tab; last tab → send the pane the same Ctrl+W byte the Cmd+W keybind sends (Ghostty perform action text:\x11), which runs the browser's own closeOrShutdown so the pane exits cleanly; falls back to close-tab if the pane can't be driven. Tests cover multi-tab, already-gone, and last-tab paths.

…ast one

The control socket's close-tab only removes the tab; on the last tab the
browser creates a fallback "New tab" page instead of exiting, so the Ghostty
pane lingered. close() now checks targets first: with other tabs present it
closes just the owned tab, and on the last tab it drives the browser's own
close path (the same Ctrl+W byte the hn-article keybind sends via Ghostty
perform action) so the companion shuts down and the pane closes cleanly,
falling back to close-tab if the pane cannot be driven. A tab already closed
with Cmd+W still counts as closed.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@Shaance
Shaance merged commit d6ed2cc into main Nov 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant