The terminal adapter (terminalCredentials over a TtyPort) MUST draw the prompt on the terminal, read the answer with no echo for a secret, and give it as a Secret; an input ended by the person (Ctrl-C, Ctrl-D, the end of the stream) and an aborted signal MUST be cancelled, and a terminal that cannot be had MUST be unavailable with the reason. The reader of the bytes (readerStep) MUST be pure: a character adds, backspace takes one away, enter ends the line, Ctrl-C and Ctrl-D end the input. What differs between systems MUST be a row of data (ttyDevicesOf: /dev/tty and stty on Linux and macOS, CONIN$ and the console's input mode on Windows), not a branch of the adapter.
Enforced (check): .github: cd commons/headless && bun run verify — suite/credential-prompt.test.ts: the terminal adapter draws the prompt, reads with no echo for a secret and with echo for a yes, never writes the value, and cancels on an ended input; the reader is pure and the devices are rows by system
Proved by: headless/suite/credential-prompt.test.ts
Written in: headless/src/surfaces/askpass/mod.ts, headless/src/surfaces/askpass/system-tty.ts, headless/src/surfaces/askpass/terminal.ts
Tests: passed: suite/credential-prompt.test.ts the terminal adapter draws the prompt, reads with no echo for a secret and with echo for a
Cited by: Headless, surfaces/askpass/system-tty, surfaces/askpass/terminal