You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The end-of-recovery prompt never waited for an answer. It read from process.stdin, but
the recovery session is a long-lived child that takes the controlling terminal, and once
it exits the inherited stdin no longer delivers a line -- readline saw end-of-input and
closed, so the question printed and vanished and the keystroke landed in the shell
instead. The prompt now reads from /dev/tty, a fresh handle on the same terminal that
is unaffected by whatever the child did, falling back to process.stdin on Windows and
where there is no controlling terminal. Whether to prompt at all is still decided by process.stdin.isTTY, so a piped stdin in a script or CI still gets no prompt even
though /dev/tty would supply one.
The terminal is opened as a tty.ReadStream rather than a plain file stream, so readline
can turn off the driver's own echo. Without setRawMode both echoed and every keystroke
appeared twice.