Open the operator's controlling terminal for interactive use, independent of
stdin/stdout (which carry the MCP protocol and must stay byte-clean —
Invariant #1).
POSIX exposes the controlling terminal as /dev/tty.
Windows exposes the console as the special device names CONIN$
(input) and CONOUT$ (output).
Returns null when no controlling terminal can be opened — e.g. the proxy
was spawned by a GUI client with no attached console. Callers must then
degrade gracefully to auto-forward rather than trapping the wire.
open/close/plat are injectable so the return-shape can be unit-tested
without a real console (interactive end-to-end testing stays manual). Tests
MUST inject close too — otherwise the real closeSync would act on the
fake fd numbers the fake open returns, closing live descriptors.
Open the operator's controlling terminal for interactive use, independent of stdin/stdout (which carry the MCP protocol and must stay byte-clean — Invariant #1).
/dev/tty.CONIN$(input) andCONOUT$(output).Returns
nullwhen no controlling terminal can be opened — e.g. the proxy was spawned by a GUI client with no attached console. Callers must then degrade gracefully to auto-forward rather than trapping the wire.open/close/platare injectable so the return-shape can be unit-tested without a real console (interactive end-to-end testing stays manual). Tests MUST injectclosetoo — otherwise the realcloseSyncwould act on the fake fd numbers the fakeopenreturns, closing live descriptors.