The old prompt saved termios, disabled ECHO, then re-read termios into the
same struct to restore it - which restored the no-echo state. Because termios
belongs to the terminal, not the fd, the user's shell was left without echo.
TCSAFLUSH also discarded a passphrase that was already queued in the tty.
Save the original state once, restore that copy, and use TCSANOW. Two
script(1) cases now cover the prompt end to end and go red on the old code.