DeMille / encrusted

A z-machine (interpreter) for text adventure games like Zork
https://sterlingdemille.com/encrusted
MIT License
128 stars 20 forks source link

Use linefeed crate for command line input #1

Open sphinxc0re opened 5 years ago

sphinxc0re commented 5 years ago

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.

Lokathor commented 5 years ago

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

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

sphinxc0re commented 5 years ago

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

Lokathor commented 5 years ago

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.

sphinxc0re commented 5 years ago

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

DeMille commented 5 years ago

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.