pub struct PtyChild { /* private fields */ }Expand description
A handle for signaling and reaping a PTY-backed child process.
Implementations§
Source§impl PtyChild
impl PtyChild
Sourcepub fn pid(&self) -> ProcessId
pub fn pid(&self) -> ProcessId
Returns the PTY session leader’s process identifier.
The spawned child creates a fresh session and foreground process group, so this PID is also the PTY process-group identifier used for later signal delivery.
Sourcepub fn wait(&mut self) -> Result<ExitStatus>
pub fn wait(&mut self) -> Result<ExitStatus>
Waits for the child process to exit and reaps it.
Sourcepub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
Attempts to reap the child process without blocking.
Sourcepub fn interrupt(&self) -> Result<()>
pub fn interrupt(&self) -> Result<()>
Sends an interrupt request to the PTY foreground process group.
Sourcepub fn terminate_forcefully(&self) -> Result<()>
pub fn terminate_forcefully(&self) -> Result<()>
Sends a forceful kill request to the PTY foreground process group.
Sourcepub fn kill(&self, signal: Signal) -> Result<()>
pub fn kill(&self, signal: Signal) -> Result<()>
Sends a signal to the PTY foreground process group.
PTY-backed sessions commonly fan out into multiple processes while sharing the foreground group created during spawn. Signaling the group preserves teardown correctness even when the session leader has already delegated work to descendants.
Sourcepub fn kill_session_leader(&self, signal: Signal) -> Result<()>
pub fn kill_session_leader(&self, signal: Signal) -> Result<()>
Sends a signal directly to the PTY session leader.
This is a teardown fallback for shells that move foreground jobs into a different process group while the session leader is still the child that must be reaped by RMUX.
Sourcepub fn continue_if_stopped(&self) -> Result<bool>
pub fn continue_if_stopped(&self) -> Result<bool>
Continues the PTY foreground process group if the session leader is currently stopped.
This mirrors tmux’s SIGCHLD policy for stopped panes while leaving SIGTTIN/SIGTTOU alone so background terminal I/O remains governed by normal Unix job-control rules.