Register console up/down history keybindings#13836
Open
juliasilge wants to merge 2 commits into
Open
Conversation
|
E2E Tests 🚀 |
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.
Fixes #13419
The console's
keyDownHandlerinconsoleInput.tsxcurrently intercepts arrow keys at the React layer before the keybinding service can see them. TheUpArrow/DownArrowcases match onKeyCodealone, so Shift+Down and Shift+Up route to history navigation instead of falling through tocursorDownSelect/cursorUpSelect, breaking text selection.This PR migrates Up/Down and Cmd/Ctrl+Up history navigation out of the React switch and into proper
Action2keybindings:NavigateInputHistoryUp(Up)NavigateInputHistoryDown(Down)NavigateInputHistoryUpUsingPrefixMatch(Cmd/Ctrl+Up)All three actions already existed (invokable from the Command Palette) but had no
keybindingblock. Adding the keybindings (a) fixes #13419 because Shift+Down no longer matchesprimary: KeyCode.DownArrow, letting the editor'scursorDownSelectwin on weight, (b) surfaces the bindings in the Keyboard Shortcuts UI (addresses part of #7380), and (c) lets user-defined keybindings override them.A new context key
positronConsoleInputCursorBoundary(mirroring upstream'sINTERACTIVE_INPUT_CURSOR_BOUNDARY) gates the keybindings so the action only fires when the cursor is at the appropriate boundary of the console input. Without this gate, the registered keybinding would steal Up/Down on interior lines of multi-line input.This also fixes a pre-existing inconsistency where the prefix-match history browser was filtering by debug mode when invoked from Cmd/Ctrl+Up but not when invoked from the Command Palette. Both paths now filter consistently.
This is the first in a planned series of console keybinding migrations to address #7380 and related problems like #9500.
Release Notes
New Features
Bug Fixes
Validation Steps
@:console @:web @:win
New e2e regression tests cover the primary fixes:
Manual checks, for example during review: