Skip to main content

PtyChild

Struct PtyChild 

Source
pub struct PtyChild { /* private fields */ }
Expand description

A handle for signaling and reaping a PTY-backed child process.

Implementations§

Source§

impl PtyChild

Source

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.

Source

pub fn wait(&mut self) -> Result<ExitStatus>

Waits for the child process to exit and reaps it.

Source

pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>

Attempts to reap the child process without blocking.

Source

pub fn interrupt(&self) -> Result<()>

Sends an interrupt request to the PTY foreground process group.

Source

pub fn terminate_forcefully(&self) -> Result<()>

Sends a forceful kill request to the PTY foreground process group.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for PtyChild

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.