fix(tui): select first row when opening terminals tab - #48490
Open
kitlangton wants to merge 1 commit into
Open
Conversation
kitlangton
enabled auto-merge (squash)
September 11, 2026 12:20
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.
Why
Opening the Terminals tab with no visible terminal leaves every row unselected. When the list is empty, even the only action, + New terminal, requires an arrow key before Enter does anything.
What Changes
Fall back to the first row when there is no matching visible terminal.
Demo
terminal-focus-before-after.mp4
Matched OpenCode Drive runs of the production TUI: before
cd504dc66a, afterbc784ff718. Both use the same isolated project, simulated model response, 90×24 terminal viewport, and interaction: open the picker, switch to Terminals, then press Enter. The clips play sequentially at native resolution for legibility, with equal-duration holds and no acceleration. Before, Enter leaves the picker open; after, it opens the terminal pane.Scope
One-line change to the Terminals tab's initial-selection fallback.
Verification
All passed. Both recorded runs completed and their frames were inspected. The pre-push hook also passed all 33 typecheck tasks using Bun 1.4.2 (27 cached).