-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pure Julia readline-like library #770
Comments
@StefanKarpinski Do you think we have the necessary I/O capability to be able to do this and in a platform independent way? It would be really cool to pull this off because one could do other julia specific interesting things as well. |
Just needs unbuffered reads and writes, and |
How does PuTTY provide a text console? Perhaps we can just borrow theirs for Windows. Wonder if it has the right abstractions. License is MIT. https://github.com/Yasushi/putty/ is an unofficial mirror if you want to browse the sources. |
Windows has their own terminal API that is not too terribly difficult to use. I'll have a look at putty and what we can do with the terminal. That could also solve the terrible color profile problems of the windows command line. |
I'm not sure it has to be all that hard. I mean, we're just talking key bindings here. If you pick the "actions" correctly, which everyone else has already done, then it's just a matter of implementing them. Then again, there's a lot of other things I can be spending my time on and I'm not sure that rewriting readline in Julia is the best choice. |
Also, if people don't want to use Readline, there's always the Web REPL. |
Done: https://github.com/loladiro/Readline.jl using Terminals
using Readline
using REPL
REPL.run_repl(Terminals.Unix.UnixTerminal(get(ENV,"TERM","xterm"),STDIN,STDOUT,STDERR)) I guess I'll close this issue and specific feature requests can be made over there. |
Looks awesome. Can't wait to try it out. |
Of course this will be in Base eventually. Could you briefly say in what way it is "almost" as powerful, i.e. what's missing, so we can plan using it to replace our current repl? |
Hmm, from the top of my head:
|
This does sound awesome! I tried it and got this error:
I notice the |
Ah, you're right. My bad, I haven't tested on any other machine yet. |
Fixed! I'll get to adding proper support for finding curses binaries soon, but it's getting later here, so no before tomorrow. |
Also, you might (will) need my changes in #3229, or you could just hold off until I get to putting this into METADATA and get it tested on other machines. |
Alright, I have verified that this works on a Linux machine (assuming you have #3229), so I'll call it a night. I'll keep working on this to get it feature complete as soon as possible. The old readline REPL really needs to go. |
This looks great!
If you can make this work you're the king! |
This is amazing! Really looking forward to having this in base. I suspect that we will be able to do all kinds of cool things going forward. Tab-completion of keyword argument names, for example. I use reverse search and forward search all the time. I even have |
This is really great. The ncurses stuff is a bit nasty but inevitable. The rest is lovely – so much better than the abomination that is our current C repl code. |
I started out with ncurses, but then I realized I didn't actually need it, so it's optional at this point. I'll move it out to a separate package soon |
Search and custom keybindings now implemented. |
As discussed here. See LineNoise for inspiration: https://github.com/antirez/linenoise.
The text was updated successfully, but these errors were encountered: