fix(opencode): disable session navigation commands when no parent session#15762
Merged
nexxeln merged 4 commits intoanomalyco:devfrom Mar 3, 2026
Merged
Conversation
…sion Session navigation commands (session_parent, session_child_cycle, session_child_cycle_reverse) are now disabled when there is no parent session. This prevents them from intercepting Up/Down/Left/Right arrow keys via the command dialog's useKeyboard handler, which was blocking prompt history navigation and other textarea key events. Closes anomalyco#15761
Contributor
There was a problem hiding this comment.
Pull request overview
Disables session navigation keybind commands that are no-ops in a root session, preventing them from intercepting raw arrow keys (Up/Down/Left/Right) and swallowing prompt-history navigation events.
Changes:
- Add
enabled: !!session()?.parentIDgating forsession_parent,session_child_cycle, andsession_child_cycle_reverse. - Ensures these commands don’t match in the global
useKeyboardcommand handler when there is no parent session.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jerome-benoit
added a commit
to jerome-benoit/dotfiles
that referenced
this pull request
Mar 2, 2026
…nt session Cherry-pick anomalyco/opencode#15762: disable session_parent, session_child_cycle, and session_child_cycle_reverse commands when no parent session exists, preventing Up/Down arrow keys from being swallowed in the prompt textarea.
nexxeln
requested changes
Mar 3, 2026
Member
nexxeln
left a comment
There was a problem hiding this comment.
this fix works for #15761, but it doesn’t address #10444 fully because session_child_cycle/session_child_cycle_reverse are still blocked when there’s no parent (enabled: !!session()?.parentID + childSessionHandler early return).
please update this pr to fully address #10444, or remove that from the description
Contributor
Author
Grappeggia
pushed a commit
to teamslop/slopcode
that referenced
this pull request
Mar 4, 2026
…sion (anomalyco#15762) Co-authored-by: Test User <test@test.com> Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
PrakharMNNIT
pushed a commit
to PrakharMNNIT/opencode
that referenced
this pull request
Mar 5, 2026
…sion (anomalyco#15762) Co-authored-by: Test User <test@test.com> Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
This was referenced Mar 7, 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.
Issue for this PR
Closes #15761
Type of change
What does this PR do?
Disables
session_parent,session_child_cycle, andsession_child_cycle_reversecommands when the current session has no parent. Without this, the bareup/downkeybinds (introduced in #14814) intercept arrow keys in the prompt textarea viauseKeyboardin the command dialog, silently swallowing the event before it reaches the history navigation handler.Adds
enabled: !!session()?.parentIDto the three commands insession/index.tsx.How did you verify your code works?
Built the TUI locally, verified Up/Down arrow keys navigate prompt history in a root session, and confirmed child session navigation still works when a parent session exists.
Screenshots / recordings
N/A — keyboard input behavior, no visual change.
Checklist