-
Notifications
You must be signed in to change notification settings - Fork 305
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
#1909 (added in 2.2.0) forces Escape
to clear the Vi mode inline completion
#3420
Comments
Entering the CMD mode means quitting general editing, so I'm not sure how much value there would be to display suggestion in that case. In your scenario, what is the difference from pressing RightArrow and then Escape? |
The first benefit is to avoid leaving the home row. Some Vi users have 60% keyboard form factors, where arrow keys are mapped to a hidden layer (requiring a layer toggle to access). I don't use a 60% myself, but I'm familiar enough with A subsequent benefit would be the ability to partially complete predictions by words using Vi motions like Keeping predictions visible in command mode would be a precursor to this feature being added to PSReadLine at some point in the future. |
We are marking this as expected behavior as when a user is out of edit mode in Vi, it does not make sense to have inline view show when they can't edit. |
@StevenBucher98 Thank you for following up on this, however I do not agree that this should be closed as Resolution-By-Design. As mentioned, leaving the inline view accessible in command mode is needed for the following:
Besides, saying this doesn't make sense for PowerShell Vi is to also say it doesn't make sense for Zsh Vi, yet Zsh Vi does what I'm describing by default and has done for some time. |
Prerequisites
Exception report
N/A
Screenshot
In both examples below, I am typing
Install-
,Escape
and thenl
withEditMode
set toVi
.In 2.1.0,
Escape
exits insert mode (as expected) and doesn't clear the inline suggestion. This allows the user to complete the line withl
, provided appropriate keybindings:In 2.2.0-beta3,
Escape
exits insert mode but also clears the inline suggestion. This takes away the ability to navigate inline predictions in command mode.I've tracked this down to #1909, which changed how
Escape
functions when predictions are visible in any view:IMO, the user should have control over whether or not the predictions view is cleared on
Escape
, whenEditMode
isVi
. Desired behaviour would be forEscape
to exit insert mode, then for a secondEscape
to clear the view.Environment data
Steps to reproduce
EditMode
toVi
, and adds a PSReadLineKeyHandler forl
that either sendsForwardChar
if there isn't a prediction, orAcceptSuggestion
if there is.ListView
and also hook up with theCommandPrediction
APIs introduced in PS 7.1 #1909, the change responsible, was introduced in 2.2.0-beta1. But I couldn't get beta1 or beta2 to work on my machine so beta3 is the earliest version to reproduce.Escape
.Expected behavior
I expect the behaviour as seen in version 2.1.0, where
Escape
doesn't clear the prediction.Actual behavior
The prediction is cleared.
The text was updated successfully, but these errors were encountered: