diff options
Diffstat (limited to 'src/blocking/pty.rs')
-rw-r--r-- | src/blocking/pty.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/blocking/pty.rs b/src/blocking/pty.rs index d864bd6..6fa3382 100644 --- a/src/blocking/pty.rs +++ b/src/blocking/pty.rs @@ -1,9 +1,14 @@ +/// An allocated pty pub struct Pty { pt: std::fs::File, pts: std::fs::File, } impl Pty { + /// Allocate and return a new pty. + /// + /// # Errors + /// Returns an error if the pty failed to be allocated. pub fn new() -> crate::Result<Self> { let (pt, ptsname) = crate::sys::create_pt()?; let pts = std::fs::OpenOptions::new() @@ -13,6 +18,10 @@ impl Pty { Ok(Self { pt, pts }) } + /// Change the terminal size associated with the pty. + /// + /// # Errors + /// Returns an error if we were unable to set the terminal size. pub fn resize(&self, size: crate::Size) -> crate::Result<()> { Ok(crate::sys::set_term_size(self, size)?) } |