-
Couldn't load subscription status.
- Fork 35.8k
Fix chat input history navigation to only trigger at first position #273169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Modified onDidChangeCursorPosition in chatInputPart.ts to only enable history navigation when cursor is at position (1,1) - This matches SCM view behavior and improves accessibility for screen readers - History navigation now requires: arrow up at first position -> cursor moves to first line -> arrow up again -> history Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
input.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the chat input history navigation to only trigger when the cursor is at the very first position (line 1, column 1), rather than anywhere on the first line. This improves accessibility for screen reader users by preventing unexpected history navigation while navigating within their input text.
Key changes:
- Modified history navigation enablement logic to check for exact first position instead of just first line
- Preserved the broader
chatCursorAtTopcontext key for other actions that need first-line detection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
scm just uses context keys. we should have one for next in history though too vscode/src/vs/workbench/contrib/scm/browser/scm.contribution.ts Lines 488 to 501 in 1c9cdcc
|

Problem
The chat input box was navigating history when the user pressed the up arrow while the cursor was anywhere on the first line. This was confusing for screen readers, as users would unexpectedly jump to history when trying to navigate within their current input text.
Solution
Modified the history navigation enablement logic to only trigger when the cursor is at the very first position (line 1, column 1), matching the behavior of the SCM view.
Expected Behavior
Starting on the second line in chat input:
Implementation
Changed the
historyNavigationBackwardsEnablementcondition inchatInputPart.ts:Before:
After:
This matches the pattern used in:
scmViewPane.tsline 1933)suggestEnabledInput.tsline 448)Benefits
Note on Context Keys
The broader
chatCursorAtTopcontext key (true anywhere on first line) was intentionally preserved, as it's used for other actions like "Focus Chat List" (Cmd+Up on Mac). Only the history navigation enablement was modified.Fixes: History navigation in chat input box should only happen on up arrow if on first char of line
cc @jooyoungseo @rperez030
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.