Skip to main content

Module backend

Module backend 

Source
Expand description

Cross-platform PTY backend traits and platform-selected implementations. PTY backend abstraction (#150).

native_pty_process.rs was riddled with #[cfg(windows)] / #[cfg(unix)] branches around the underlying portable-pty calls. After the #150 rewrite we have two distinct backends:

  • Windows - conpty::ConPtyBackend (raw ConPTY via windows-sys with PSEUDOCONSOLE_PASSTHROUGH_MODE enabled)
  • Unix - unix::PortablePtyBackend (a thin wrapper around portable-pty’s native_pty_system, unchanged behavior)

The Backend type alias resolves to one or the other per-target, and native_pty_process.rs makes a single Backend::openpty(...) call instead of branching.

Structs§

PtySize
Caller-facing PTY dimensions. Pixel fields are ignored on Windows (ConPTY only consumes rows/cols). Mirrors portable-pty’s shape so caller code passes them through unchanged.

Traits§

PtyBackend
Factory trait for opening platform-specific pseudo-terminal pairs.
PtyChild
Platform-neutral handle for a child process running inside a PTY.
PtyMaster
Platform-neutral handle for the master side of a pseudo-terminal.
PtySlave
Platform-neutral handle for the slave side of a pseudo-terminal.