Skip to main content

Crate nexcore_pty

Crate nexcore_pty 

Source
Expand description

POSIX pseudo-terminal allocation — safe wrappers around openpty(3) and friends.

Foundation-layer crate with a single external dependency (libc). Wraps openpty(), fork(), setsid(), dup2(), execvp(), and TIOCSWINSZ ioctl behind safe Rust functions.

§Supply Chain Sovereignty

This crate replaces external PTY crates (nix, portable-pty) with a minimal, auditable wrapper around POSIX system calls. ~250 lines, zero transitive dependencies beyond libc.

§Primitive Grounding

∂(Boundary) + ς(State) + →(Causality)

Structs§

PtyPair
A matched pair of PTY file descriptors (master + slave).
SpawnConfig
Configuration for spawning a child process in a PTY.
WinSize
Terminal dimensions for PTY allocation and resize.

Enums§

PtyError
Errors from PTY operations.

Functions§

fork_exec
Fork and exec a program in the slave PTY.
open_pty
Allocate a new pseudo-terminal pair.
read_master
Read bytes from a PTY master fd (synchronous).
resize
Resize the terminal via TIOCSWINSZ ioctl.
set_nonblocking
Set a file descriptor to non-blocking mode (O_NONBLOCK).
signal_process
Send a signal to a process.
try_wait_pid
Non-blocking wait for child exit status.
write_master
Write bytes to a PTY master fd (synchronous).