Hey!

I'm writing a CLI. Getting input with `readLineFromStdin()` from `rdstdin` 
works fine. (except: when deleting with backspace, unicode characters are not 
removed entirely, but it's not a big problem)

I'd like to implement an edit functionality, i.e. `readLineFromStdin()` but 
with a "default value".

So the default value is already in the buffer and the user can remove/add/edit 
characters.

Example use case:

  1. User inputs single line text
  2. CLI asks for verification
  3. User catches an error and would like to edit their previous input
  4. CLI shows editable input with the previous input already filled in



I don't want to uses `curses` if possible, I'd like to keep it simple and 
"inline".

I looked into the `linenoise` docs, but it seems like I can only add "history" 
and "completion". It's not the best if the user has to make same action to get 
the previous input in the mentioned use case.

Any suggestions?

Thanks in advance!

Reply via email to