Krikri::PluginHelpers::ScriptPtyCapture
Class methods
The one line a ssh -tt mux-client session leaves on its own
stderr when the session closes (openssh's clientloop.c), which
under the pty merge becomes the whole module stderr.
The source-side half of the same merge: real's remote raw (a
shell-forced run through ssh -tt, issue #490) delivers the
command's stdout AND stderr on the ONE pty, in execution order -
a property no post-hoc concatenation of two separately captured
pipes can reproduce. The caller therefore wraps its invocation in
a { ...; } 2>&1 group (one pipe, order preserved, exit code
intact), exactly like the remote script run does; a run whose
connection has no pty must not wrap.
The captured run's output as the pty yields it to the module: ONLCR turns every \n into \r\n. Embedded \r characters pass through untouched, exactly like the pty's output-side translation (it never looks at an already-\r byte).
Whether the module capture gets the command module's trailing \r/\n strip. Real's raw ACTION returns the pty capture untouched (no command-module strip; the script action behaves the same), so a pty-merged capture must keep its final "\r\n" for the executor's raw_remote_pty_shape to match ansible's stdout - only plain-pipe captures follow strip_empty_ends.