bhauman / rebel-readline

Terminal readline library for Clojure dialects
Eclipse Public License 1.0
675 stars 35 forks source link

History search doesn't seem to work #138

Open bkovitz opened 6 years ago

bkovitz commented 6 years ago

In :viins mode, when I hit "Esc /", the string "?" appears below the command line, and then everything I type causes a beep without echoing the character until I hit Enter, and then I'm back to a blank command; it doesn't search the history. If I hit "Esc ?", the same thing happens except the string below the command line is "/".

I tried searching in :emacs mode and seemed to get a similar result, but I'm not sure that I'm searching in :emacs mode correctly.

(Version 0.1.1 of rebel-readline.)

bhauman commented 6 years ago

Please check the bindings that are available to you in :viins with :repl/key-bindings and note that CTRL R does an incremental search that uses the characters that the line starts with.

This behavior comes solely from Jline3 and problems / improvements to behavior should be addressed there, for now.

bhauman commented 6 years ago

Oh I see you are in vicmd mode yeah that seems broken.

bhauman commented 6 years ago

I'd like to think that this is Jlines fault but I'll data a look.

bkovitz commented 6 years ago

:repl/key-bindings doesn't mention any bindings for either "/" or "?".

bkovitz commented 6 years ago

"^[" is bound to vi-cmd-mode (as it should be). So yeah, this looks like a JLine bug.

bkovitz commented 6 years ago

Bruce, you might enjoy a look at this StackOverflow question, to which rebel-readline is the answer:

https://stackoverflow.com/questions/48273016/how-can-i-get-readline-rlwrap-like-functionality-when-using-clojure-main-repl

By the way, I read your manifesto at https://github.com/bhauman/rebel-readline/blob/master/rebel-readline/doc/intro.md and I'd like to say hallelujah! and thank you! I've been using Clojure on and off for about two years now, and I think I still don't really know how to use it properly. I know that people rave about the REPL, but I've never had good results with it, so I'm surely missing some crucial experience or information. A good REPL to give newcomers a good first Clojure experience sounds like an idea whose time has come. Much gratitude for making this!

Ben

bhauman commented 6 years ago

Thanks Ben!