Repository navigation
Fix Esc leaving an empty New-tab page when the article tab is the last one - #28
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.