Modify the NextWord handler to accept the next suggestion word for consistently using the Ctrl+RightArrow key
The Ctrl+RightArrow now moves the cursor word-by-word for both editing the line and accepting suggestions
Before, the NextWord handler did not operate on the suggestion text when the cursor was at the end of the line
NextWord is now an alternative to the less consistent custom binding ForwardCharAndAcceptNextSuggestionWord defined in the SamplePSReadlineProfile.ps1 script
ForwardCharAndAcceptNextSuggestionWord is less consistent because it mixes word movement, line movement, and character movement in a single key
NextWord is now consistent because the Ctrl+RightArrow key moves the cursor uniformly in the editing and suggestion cases
This commit is a feature addition, and it does not impact the previous use of the Ctrl+RightArrow key in Windows
PR Checklist
[x] PR has a meaningful title
Use the present tense and imperative mood when describing your changes
[x] Summarized changes
[ ] Make sure you've added one or more new tests
[x] Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
PR Summary
NextWord
handler to accept the next suggestion word for consistently using theCtrl+RightArrow
keyCtrl+RightArrow
now moves the cursor word-by-word for both editing the line and accepting suggestionsNextWord
handler did not operate on the suggestion text when the cursor was at the end of the lineNextWord
is now an alternative to the less consistent custom bindingForwardCharAndAcceptNextSuggestionWord
defined in theSamplePSReadlineProfile.ps1
scriptForwardCharAndAcceptNextSuggestionWord
is less consistent because it mixes word movement, line movement, and character movement in a single keyNextWord
is now consistent because theCtrl+RightArrow
key moves the cursor uniformly in the editing and suggestion casesNextWord
is not in the list of the advertised functionsCtrl+RightArrow
key in WindowsPR Checklist
User-facing changes
Microsoft Reviewers: Open in CodeFlow