pub struct TerminalState { /* private fields */ }Expand description
Terminal state for interactive job control.
Created once at REPL startup. Manages signal disposition and terminal foreground process group.
Implementations§
Source§impl TerminalState
impl TerminalState
Sourcepub fn init() -> Result<Self>
pub fn init() -> Result<Self>
Initialize terminal state for interactive job control.
- Puts the shell in its own process group
- Ignores SIGTSTP, SIGTTOU, SIGTTIN (so the shell isn’t stopped)
- Takes the terminal foreground
Sourcepub fn give_terminal_to(&self, pgid: Pid) -> Result<()>
pub fn give_terminal_to(&self, pgid: Pid) -> Result<()>
Give the terminal foreground to a process group.
Sourcepub fn reclaim_terminal(&self) -> Result<()>
pub fn reclaim_terminal(&self) -> Result<()>
Reclaim the terminal foreground for the shell.
Sourcepub fn wait_for_foreground(&self, pid: Pid) -> WaitResult
pub fn wait_for_foreground(&self, pid: Pid) -> WaitResult
Wait for a foreground process, handling stop signals (WUNTRACED).
This blocks the current thread. Call from block_in_place.
Auto Trait Implementations§
impl Freeze for TerminalState
impl RefUnwindSafe for TerminalState
impl Send for TerminalState
impl Sync for TerminalState
impl Unpin for TerminalState
impl UnsafeUnpin for TerminalState
impl UnwindSafe for TerminalState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more