Asks for a secret on the terminal with echo off. Enter ends the input,
Backspace removes the last character, Ctrl+C cancels. Escape sequences
are removed from the input, also when a chunk ends in the middle of one:
CSI (arrow keys, Delete, paste markers, keeping the pasted text), SS3
(ESC O and a key), and ESC with the one character after it (Alt+key).
A control character inside a sequence ends it and is handled as usual,
so Enter and Ctrl+C always work.
Asks for a secret on the terminal with echo off. Enter ends the input, Backspace removes the last character, Ctrl+C cancels. Escape sequences are removed from the input, also when a chunk ends in the middle of one: CSI (arrow keys, Delete, paste markers, keeping the pasted text), SS3 (ESC O and a key), and ESC with the one character after it (Alt+key). A control character inside a sequence ends it and is handled as usual, so Enter and Ctrl+C always work.