haskell / haskeline

A Haskell library for line input in command-line programs.
https://hackage.haskell.org/package/haskeline
BSD 3-Clause "New" or "Revised" License
221 stars 75 forks source link

Change up/down keys to cycle through history with currently typed prefix #14

Closed drew-gross closed 5 years ago

drew-gross commented 9 years ago

I propose "searchForPrefix" to be the default behaviour for the up and down arrow keys.

-If you press up/down without typing anything, this is the same as before, as far as I can tell -If you press up/down after typing, this behaviour is typically the behaviour you want -If you press up/down after typing, and want the old behaviour, it is quick to kill the line and press up again with C-a-k or C-S-backspace in emacs mode, S in vi mode, or Ctrl+C in ghci, which is probably the vast majority of uses of ghci.

I get that this might be too big of a change from existing behaviour, but if you won't accept this patch, would you accept one that lets the user change the behaviour of the up/down keys in their settings file?


This change is Reviewable

mxswd commented 9 years ago

Sorry I disagree, this isn't the behaviour I expect. I often hit up on incomplete commands to go back and find things.

judah commented 5 years ago

Closing in favor of #87/#90. This seems better as a configurable option rather than the default.