I'm looking for a crate to read and react to single characters without the user having to press enter.
- I only need Linux support, other platforms are irrelevant.
- I need to display a prompt (for examples:
Apply changes? [Yes/No/Diff/Ask for each file]
where the user can then enter Y, N, D or A). - The code is not async or multi threaded at this point in the program execution, so I don't need to worry about other parts of the output clobbering the terminal.
- The code will be running in normal terminal mode with scrollback, none of that "alternate screen mode". This is not a full TUI program. Just a CLI program with some interactive questions.
It seems something like rustyline or reedline should fit, but it seems those only return control to the program when the user presses enter. I can't really find anything for my use case.
I'm sure ratatui could probably do this, but that seems like way overkill.