chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.62k stars 143 forks source link

Allow cycling through auto suggestions #529

Closed DVLP closed 11 months ago

DVLP commented 11 months ago

Auto suggestions are awesome, instead of pressing Ctrl + R they are always there, but cannot be cycled though like when pressing Ctrl + R multiple times.

A button is needed to cycle i.e. Ctrl + arrow up/down

chrisant996 commented 11 months ago

@DVLP I think what you mean is that you want a key to cycle through history lines that match what's been typed so far. (That's not related to auto-suggestions.)

I think you're looking for the PgUp and PgDn keys which are by default bound to history-search-backward and history-search-forward.

For info on how to change key bindings, see Customizing Key Bindings and Init File and Bindable Commands.

DVLP commented 11 months ago

Thanks @chrisant996 this is very useful. Is auto-suggestion simply the last matching history entry?

chrisant996 commented 11 months ago

Is auto-suggestion simply the last matching history entry?

No. Which is why "cycle through all the possible auto suggestions" doesn't make sense. Unless you mean cycle through the possible "strategies", not suggestions. I recommend reading the documentation about auto suggestions, for more info.

DVLP commented 11 months ago

From the user's perspective it doesn't matter how it's called internally. In many cases there can be more than one candidate for the input and it does make sense to be able to go to the next most likely result.

chrisant996 commented 11 months ago

From the user's perspective it doesn't matter how it's called internally. In many cases there can be more than one candidate for the input and it does make sense to be able to go to the next most likely result.

I recognize that the auto suggestions feature can be confusing. It is not intended to be something that provides multiple choices or that could cycle through choices.