Prerequisites
Description of the new feature/enhancement
Many users, especially those with Emacs muscle memory, expect Ctrl+e to move the cursor to the end of the line (the EndOfLine function).
With the introduction of predictions, many of these same users want to bind Ctrl+e to also accept the full inline suggestion, similar to how RightArrow works.
The current, discoverable way to do this is:
Set-PSReadLineKeyHandler -Chord 'Ctrl+e' -Function AcceptSuggestion
However, this binding completely overrides the original EndOfLine behavior. This forces the user to choose between one function or the other, which is a poor experience.
Proposed technical implementation details (optional)
I propose adding a new, built-in PSReadLine function (e.g., EndOfLineOrAcceptSuggestion) that intelligently combines both behaviors.
The logic for this new function would be:
- If the cursor is not at the end of the line, perform the
EndOfLine action.
- If the cursor is already at the end of the line, perform the
AcceptSuggestion action.
This would create a "smart" key binding that "does the right thing" based on context.
Prerequisites
Description of the new feature/enhancement
Many users, especially those with Emacs muscle memory, expect
Ctrl+eto move the cursor to the end of the line (theEndOfLinefunction).With the introduction of predictions, many of these same users want to bind
Ctrl+eto also accept the full inline suggestion, similar to howRightArrowworks.The current, discoverable way to do this is:
However, this binding completely overrides the original
EndOfLinebehavior. This forces the user to choose between one function or the other, which is a poor experience.Proposed technical implementation details (optional)
I propose adding a new, built-in
PSReadLinefunction (e.g.,EndOfLineOrAcceptSuggestion) that intelligently combines both behaviors.The logic for this new function would be:
EndOfLineaction.AcceptSuggestionaction.This would create a "smart" key binding that "does the right thing" based on context.