Expand description
12.3: the display rule (the keys note, section 7). A recovery code is
shown only to a person at a terminal: stdout and stdin are terminals, no
known agent-harness marker is set, and the controlling terminal opens.
It’s shown through the controlling terminal, after a key press, on the
alternate screen, so nothing reaches stdout or stays in scrollback. On
Windows there’s no alternate screen (the escapes are Unix-only), so the
code stays in the console’s scrollback; init --help and the CHANGELOG
say so.
Constants§
- AGENT_
MARKERS - Environment variables that agent harnesses set in the commands they run. Each is checked against its vendor’s documentation, cited here. A marker only makes the rule stricter; only whether it’s set (and not empty) is read. A best effort: it can only name harnesses someone has checked, so the key press is the guard that doesn’t depend on it.
- REFUSAL
- What the user is told when a code isn’t shown.
Functions§
- ask_
hidden - Ask on the controlling terminal for
promptand read the answer without echo (onboard’s confirmation of the last group). - marker_
reason - The marker part of the rule, over an environment lookup (for tests).
- refusal_
reason - Why the rule doesn’t hold here, or
Nonewhen it does. - show
- Show
codeunder the rule: ask for Enter first, then show it on the alternate screen, wait for Enter again, and leave it. Call only whenrefusal_reasonisNone. The answers are read without echo.