piotrmurach / tty-prompt

A beautiful and powerful interactive command line prompt
https://ttytoolkit.org
MIT License
1.47k stars 136 forks source link

CTRL+D stops input in single line mode #204

Open coezbek opened 1 month ago

coezbek commented 1 month ago

I am curious to understand why pressing CTRL+D on a Prompt::ask would stop data entry, because in readline it would cause a delete of the next character.

The documentation seems to indicate that CTRL+D is only used in multiline mode, but the code does not distinguish and has no option to prevent TTY::Prompt to consume CTRL+D (and also CTRL+Z). I think by default CTRL+Z should be passed to the shell.

coezbek commented 1 month ago

Okay, it seems that this is implemented but not yet released in tty-reader: https://github.com/piotrmurach/tty-reader/commit/485ce80d43d26ab264438ccb9bc680d9c4322d63