PtyConnector
TerminalConnector backed by a local PTY process.
This connector owns PTY reader and watcher threads. It only moves bytes and lifecycle events between the PTY process and a connector listener; parser, core, cursor, attribute, and input-encoder behavior are owned by terminal-session and lower layers. Normal closure follows both process exit and delivery of stdout through EOF. Local close cancels pending reads instead of draining; read or byte-listener failure reports the original error and releases the process and both streams once. Listener callbacks may close this connector reentrantly.
Parameters
the underlying PTY process.
size of the read buffer in bytes.
name for the daemon PTY stdout reader thread.
name for the daemon process exit watcher thread.
lifecycle latch completed by the reader and awaited after process exit.
Functions
Reads the Unix foreground process-group leader or uses the newest live descendant on Windows. The Windows result is a heuristic and may identify a background child. Returns only a basename, or null on closure/unavailable metadata; applications inside SSH or WSL are not inspected.
Waits for the child process to exit and returns its exit code. This does not wait for output delivery; TerminalConnectorListener.onClosed is the completion boundary for drained output.