encrusted icon indicating copy to clipboard operation
encrusted copied to clipboard

Use linefeed crate for command line input

Open sphinxc0re opened this issue 6 years ago • 5 comments

The rustyline crate provides a nice and clean way to set up an interactive console while supplying tools for creating a history and navigating the command line.

sphinxc0re avatar Aug 13 '18 16:08 sphinxc0re

That project is quite possibly dead, even though it is 1.0

The linefeed project is similar, but still active (but not 1.0).

Lokathor avatar Aug 14 '18 03:08 Lokathor

But it works perfectly and is totally stable. So why should we use linefeed instead? Rustyline has a very nice API.

sphinxc0re avatar Aug 14 '18 08:08 sphinxc0re

Well any version of any crate is stable if you just never switch versions :P so I'm not sure how "1.0 and it will never update" is in any way better than "0.5 but it will get updates". At least in the latter case there's a chance that newer versions will break little and give you some nice new ability in exchange.

But particularly to your question of what linefeed gets right: linefeed allows for concurrent output to happen while a line-reading is taking place without disrupting the line-reading prompt and partial input from being displayed properly. As far as I can tell rustyline has no similar ability.

Lokathor avatar Aug 14 '18 09:08 Lokathor

I mean, as long as it cleans up the UX of the command prompt it's fine.

sphinxc0re avatar Aug 14 '18 09:08 sphinxc0re

Yeah I definitely want to take a look into these. Right now the terminal UI is suuuper basic. I struggled for a while to make sure I could build both the wasm and normal targets, but I think I have them separated enough now to introduce something like this.

DeMille avatar Aug 17 '18 06:08 DeMille