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:
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!
I couldn't edit my original post (archived), but here's a shorter version:
I'd like to implement an edit line functionality, so something similar to 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:
In my app, currently I can only implement an edit idea functionality by requiring reinputting the whole line again.