PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.74k stars 295 forks source link

Prediction `NextSuggestion` or similar binding that also works with inline predictions #3362

Open TBBle opened 2 years ago

TBBle commented 2 years ago

Prerequisites

Description of the new feature/enhancement

Trying out the newly-default inline prediction, and particularly combined with https://github.com/PowerShell/CompletionPredictor, I wanted to have Tab and Shift+Tab work with the predictions rather than the completions, so that I get history (and any other plugins) included in the Tab-complete keyboard habit for free, without losing screen real-estate to the list-view (or having to toggle F2 every time I want to choose a different prediction).

However, the NextSuggestion and PreviousSuggestion bindings only work in list view. They default to unbound, so the arrow keys you naturally use in the prediction list view are clearly magic for list view, not using those bindings.

Proposed technical implementation details (optional)

Either

I'm clearly assuming that the underlying mechanism is the same so this would be a relatively easy feature to add, but that's just an assumption.

StevenBucher98 commented 1 year ago

Thanks for the issue @TBBle! Are you trying to use Tab to accept a given inline suggestion? Or cycle through different potential suggestions? and then accept it with the right arrow key?

You can change the AcceptSuggestion binding to have a key to accept the inline suggestion.