mikaelmello / inquire

A Rust library for building interactive prompts
https://docs.rs/inquire
MIT License
1.71k stars 72 forks source link

Support for up-arrow previous prompt history, and control-keys #224

Open mikecvet opened 4 months ago

mikecvet commented 4 months ago

It would be great if there was a way to support input history with the Text, which iterated through prior entries through the up-arrow.

Also, on Mac OS, cntl-D seems to just input 'd' rather than a shell-like exit command, though cntl-C quits properly.

msrd0 commented 4 months ago

For me, not only ctrl+D does not properly send end-of-input, but ctrl+C also does not quit. Other control keys like ctrl+A (that's jump to begining of the line in bash) and ctrl+K (kill from cursor to end of line in bash) also just enter the characters as if ctrl was not pressed. It would be nice if those worked out of the box, at least when using bash which usually supports these kinds of controls.

mikecvet commented 3 months ago

Added suggested history implementation here https://github.com/mikaelmello/inquire/pull/229