pub trait PtyMaster:
AsyncRead
+ AsyncWrite
+ Send
+ Sync
+ Unpin {
// Required methods
fn resize(&self, size: WindowSize) -> Result<()>;
fn window_size(&self) -> Result<WindowSize>;
fn close(&mut self) -> Result<()>;
fn is_open(&self) -> bool;
fn as_raw_fd(&self) -> RawFd;
}Expand description
The master side of a pseudo-terminal.
This trait represents the controller end of a PTY pair. It provides async read/write access to the terminal and methods for controlling the PTY (resizing, closing, etc.).
§Platform Behavior
- Unix: Wraps a file descriptor for the master PTY.
- Windows: Wraps
ConPTYinput/output pipes.
Required Methods§
Sourcefn resize(&self, size: WindowSize) -> Result<()>
fn resize(&self, size: WindowSize) -> Result<()>
Resize the PTY to the given window size.
This sends a window size change notification to the child process
(SIGWINCH on Unix, ConPTY resize on Windows).
Sourcefn window_size(&self) -> Result<WindowSize>
fn window_size(&self) -> Result<WindowSize>
Get the current window size.