chrisant996 / clink

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

How to move through history? #641

Closed Mitezuss closed 1 month ago

Mitezuss commented 1 month ago

while write, i get some suggestion, but wanna another (from the history): how? (any key o what ?)

regards

chrisant996 commented 1 month ago

Are you looking for the info in the "Persistent History" box at Feature Highlights in the documentation?

Mitezuss commented 1 month ago

Are you looking for the info in the "Persistent History" box at Feature Highlights in the documentation?

Thank, it was:

PgUp and PgDn cycle through history entries matching the typed prefix.

And:

"\e[A":             history-search-backward         # Up (replaces `previous-history`)
"\e[B":             history-search-forward          # Down (replaces `next-history`)
"\e[5~":            clink-popup-history             # PgUp (replaces `history-search-backward`)
"\e[6~":                                            # PgDn (cleared because I redefined PgUp)
chrisant996 commented 1 month ago

Yes, the only reasons I haven't changed the default bindings for Up, Down, and PgUp are these:

  1. Many Clink users want bash key bindings and may be annoyed if those behave differently.
  2. In both bash and CMD, the default behavior of Up/Down is to move through the history without regard for what's been typed so far. Changing that can be unexpected and annoying to some users.
  3. I could change them when clink.default_bindings is windows, but those are such core to the shell experience that I'm worried about creating confusion if Up/Down "mysteriously" behave differently for different users, making it difficult to share steps or communicate about steps for various things.
  4. Imposing changed key bindings on everyone ruins muscle memory, and is usually a bad idea.

I have strong personal preferences about how keyboard bindings "Should" work, but I try not to impose my preferences on others if bash/CMD already have strong precedent for something.

Which is why I shared a stripped-down version of my own key bindings (which I've gotten a lot of positive feedback about).

chrisant996 commented 1 month ago

I've updated the Saved Command History documentation to clarify some things and include a table of key bindings for navigating the history.