Closed cespare closed 8 years ago
Liner has context-sensitive history. If you type a few characters and then press Up, liner will only show you the history entries that start with those characters.
By moving the cursor horizontally, you reset the context, and liner looks for more history that starts with your entire line (and doesn't find anything).
FWIW, this behavior surprised me quite a bit and was works differently from all the other readline-like console interfaces I use every day. If I wanted to do a prefix search, I would use ctrl-r (which is separately a supported feature?)
I'll close this since it's WAI, though.
Context-sensitive history predates Ctrl-R support by over half a year.
If we already had Ctrl-R, I probably would have rejected the context-sensitive history patch. But since I accepted it at the time, I'm hesitant to remove it (because there's no way of knowing who depends on it).
If you hit up a few times to get to a previous item from the history and then move the cursor, up/down (as well as ctrl-p/ctrl-n) no longer do anything.
(In my testing, I did find a case one or two times where it did start working again afterwards in a buggy way for some reason, but mostly it just didn't work. I'm hoping it's easy for you to reproduce.)
I checked that redis-cli doesn't have this problem, so I'm assuming linenoise handles this fine.