pub fn pty_window(
master: &Fd,
rows: u16,
cols: u16,
) -> Result<(u16, u16), CoreError>Expand description
Apply an initial window size to a pty master before the child execs and
read back the actual winsize the kernel holds.
This is the single source of truth for the pty’s starting geometry: callers
that need LINES/COLUMNS in the child environment must derive them from
the returned (rows, cols) — the TIOCGWINSZ read-back — not from the
values they passed in. Two writers of the same fact (the wire dims and a
separate TIOCSWINSZ) can drift the moment one call site changes; the
read-back keeps the env provably consistent with what the kernel/pty layer
believes.
§Errors
EINVAL:rowsorcolsis zero.ENOTTY:masteris not a terminal.