-
Notifications
You must be signed in to change notification settings - Fork 85
Conversation
session.reverseSearchBuffer = ''; | ||
|
||
if (clear) { | ||
session.rl.write(null, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't readline.clearLine
from the api also work?
https://nodejs.org/api/readline.html#readline_readline_clearline_stream_dir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try that and it didn't seem to work for some reason.
I love it! Comparing with
I had one inline comment, but otherwise this looks good to me. Actually it occurred to me this might be a great general-purpose node library or enhancement to https://www.npmjs.com/package/historic-readline (not saying you should put in the additional work of course). |
I was thinking exactly that when talking about upgradable general purpose node repl. Antonio, you are really raising the bar for node repls here 😉 |
Thanks for your feedback! I'll definitely incorporate those features. I tried to follow rlwrap style reverse-i-search as close as possible but apparently missed some small behaviors :-) |
07e8280
to
565d2fb
Compare
@pesterhazy just added a commit that addressed your early feedback. Mind giving it another go to see if it satisfies all requirements now? |
@anmonteiro just compiled the updated version, works fabulously. It's hard to tell the difference to "real" readline. 🥇 |
c177ce2
to
199e62c
Compare
@pesterhazy thanks so much for trying it out. Just did some cleanup wrt. duplicates & entering multiline forms. Planning to ship it tomorrow morning if nothing major comes up. |
Summary of the changes in this commit: 1. Set prompt to `(failed reverse-i-search)` when the reverse search fails 2. Have cursor keys cancel reverse search mode
574f4b2
to
fee7301
Compare
No description provided.