Repository navigation
fix(tui): prioritize composer keybinds - #42384
Merged
Merged
Conversation
kitlangton
enabled auto-merge (squash)
August 13, 2026 18:01
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
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.
What
Replace the Shell tab's hard-coded
Ctrl+Dinterceptor with OpenTUI keymap layer priority for the full composer.Closes #42377.
Before / After
Before: #42366 restored the default Shell kill shortcut with a raw event interceptor that recognized only literal
Ctrl+D. Custom bindings and the adjacent composer navigation/Subagents layers still depended on equal-priority registration order against focused-editor bindings.After: Composer navigation and active tab actions use contextual priority. Their configured bindings win while the composer is active, including custom bindings, without matching physical keys manually.
How
priority: 1.Investigation
Focused rendered-component tests showed permission rejection, textual forms, autocomplete destructive actions, and ordinary non-default editor collisions already behave correctly. Lowering
app.exitpriority did not fix the real TUI. Applying priority to the active composer layers did.Testing
bun run test test/cli/tui/composer-keymap.test.tsxfrompackages/tui: 3 passedbun typecheckfrompackages/tui: passedtermctrlagainst the elected service: opened composer, switched Subagents → Shell, pressedCtrl+D, observed the shell disappear, and confirmed its ID was absent from/api/shellFlow
flowchart LR Key[Configured keypress] --> Mode{Composer active?} Mode -- no --> Editor[Normal global/editor binding] Mode -- yes --> Priority[Priority 1 composer layer] Priority --> Action[Navigation or active-tab action]