Repository navigation
Conversation
In ideshell.Handler, the compMoved boolean tracks whether the user has navigated away from the initial candidate (index 0) in the completion overlay. When accepting completion via Enter or Tab, acceptSearch checks !h.compMoved and resets focus to index 0 via FocusStart if no query filter characters were typed. While Ctrl-j/Ctrl-n and Ctrl-k/Ctrl-p set h.compMoved = true, the term.KeyArrowUp and term.KeyArrowDown event handlers omitted setting this flag. Navigating candidates using arrow keys followed by Enter or Tab erroneously reverted the selection to the first candidate. Set h.compMoved = true when processing term.KeyArrowUp and term.KeyArrowDown in handleCompletion. Fixes unstablebuild#89 Signed-off-by: Spandan Mishra <[email protected]>
ernestrc
enabled auto-merge (squash)
September 20, 2026 21:16
ernestrc
disabled auto-merge
September 20, 2026 21:16
ernestrc
enabled auto-merge (squash)
September 20, 2026 21:16
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ernestrc
approved these changes
Sep 26, 2026
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
Fixes #89.
As per approval by @ernestrc on discord: https://discord.com/channels/1498290662095716374/1549066961932124210/1550224117976924271
When navigating completion candidates in the Rune console (
rune>) using theArrowDownorArrowUpkeys, pressingEnterorTaberroneously accepted the very first candidate instead of the highlighted candidate.Root Cause
ideshell.Handlertracks candidate navigation usingh.compMoved. When accepting completion viaacceptSearch(), iflen(h.query) == 0and!h.compMoved,h.list.FocusStart()is called to reset focus to index 0. While theCtrl-n/Ctrl-jbindings seth.compMoved = true, theKeyArrowDownandKeyArrowUpbranches omitted setting this flag.Changes
internal/ide/ideshell/handler.go(handleCompletion), seth.compMoved = trueunderterm.KeyArrowUpandterm.KeyArrowDown.internal/ide/ideshell/completion_test.go, addedTestCompletion_ArrowKeyNavigationPreservedOnAcceptverifying that arrow key navigation is preserved upon accepting with bothEnterandTab.Results
screenrecording-2026-09-18_17-30-40.mp4