uiua
uiua copied to clipboard
🛠️ Enhancement: Support Multiline Input in REPL
Hello,
I’ve been working on patches for uiua-mode in Emacs to enable a more interactive development workflow with UIUA. While testing REPL integration, I noticed that UIUA’s REPL currently supports multiline input only via bracketed paste, which is only active when stdin is a TTY.
Specifically, the REPL reads a single line at a time using rustyline::Editor::readline, which means when running in non-TTY environments (like Emacs via comint, which pipes to stdin), multiline input does not work.
Here’s the relevant REPL implementation: https://github.com/uiua-lang/uiua/blob/84d9855f0f294fa995f0201e66a394294e6ebb28/src/main.rs#L1155-L1179
It would be a big improvement if UIUA’s REPL supported multiline input more explicitly — for example, by using a read_multiline loop like rlua, where empty lines or other delimiters indicate the end of an input block.
I’d be happy to test this if helpful. If I can find time, I might also attempt a prototype myself.
Also open to other suggestions or ideas.
Regards, Aeonik
I'd accept a PR on this.
I would like to work on this issue, if it is not picked up!
Let me know if you do, I was thinking about taking a stab at it in a few weeks when I get more free time, but it would be my first time using Rust in a real project.
If you start before me, I will test your code, and provide feedback.
Sure.. I will give it a try.. And let you know. Thanks