pub struct PtyMaster { /* private fields */ }Expand description
PTY Master side (controlled by terminal emulator)
Implementations§
Source§impl PtyMaster
impl PtyMaster
Sourcepub fn read(&self, buffer: &mut [u8]) -> Result<usize, KernelError>
pub fn read(&self, buffer: &mut [u8]) -> Result<usize, KernelError>
Read from slave output (what the slave wrote)
Sourcepub fn write(&self, data: &[u8]) -> Result<usize, KernelError>
pub fn write(&self, data: &[u8]) -> Result<usize, KernelError>
Write to slave input (what the slave will read)
Sourcepub fn set_winsize(&self, winsize: Winsize)
pub fn set_winsize(&self, winsize: Winsize)
Set window size
Sourcepub fn get_winsize(&self) -> Winsize
pub fn get_winsize(&self) -> Winsize
Get window size
Sourcepub fn set_flags(&self, flags: TermiosFlags)
pub fn set_flags(&self, flags: TermiosFlags)
Set terminal flags
Sourcepub fn get_flags(&self) -> TermiosFlags
pub fn get_flags(&self) -> TermiosFlags
Get terminal flags
Sourcepub fn set_controller(&self, pid: ProcessId)
pub fn set_controller(&self, pid: ProcessId)
Set the controlling process for this PTY.
The controlling process receives signals (SIGINT, SIGTSTP, SIGWINCH) generated by special terminal characters (^C, ^Z) and window size changes.
Sourcepub fn get_controller(&self) -> Option<ProcessId>
pub fn get_controller(&self) -> Option<ProcessId>
Get the controlling process ID, if any.
Sourcepub fn set_foreground_pgid(&self, pgid: u64)
pub fn set_foreground_pgid(&self, pgid: u64)
Set the foreground process group ID for this terminal.
The foreground process group receives keyboard-generated signals (SIGINT from ^C, SIGTSTP from ^Z). Processes in background groups that attempt to read from or write to this terminal receive SIGTTIN or SIGTTOU respectively.
Sourcepub fn get_foreground_pgid(&self) -> u64
pub fn get_foreground_pgid(&self) -> u64
Get the foreground process group ID for this terminal.
Returns 0 if no foreground group has been set.