WIP: Implement REPL with non-blocking mainloop
This MR implements a non-blocking REPL using Node's internal readline to provide ANSI key parsing and terminal manipulation. It uses Gio UnixStreams on supported platforms and falls back to our previous gets
implementation on unsupported platforms (export GJS_REPL_NO_MAINLOOP=true
is provided to test the fallback)
Prior Art
- Node.js readline
- iPython (the interface REPL Python uses)
Demo
Changelist
- Implement a basic Repl using Gio Unix streams and Node's readline utilities
- Include a fallback on blocking reads for Windows and other unsupported platforms
- Replace
Console.interact()
withnew Repl().run()
- (temporarily) add a
-i
flag to start theRepl
specifically.
Closes #76
Edited by Evan Welsh