Upload spectral-pty/src/lib.rs
Browse files- spectral-pty/src/lib.rs +17 -0
spectral-pty/src/lib.rs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use std::io::{Read, Write};
|
| 2 |
+
|
| 3 |
+
#[cfg(unix)]
|
| 4 |
+
pub mod unix;
|
| 5 |
+
|
| 6 |
+
#[cfg(windows)]
|
| 7 |
+
pub mod windows;
|
| 8 |
+
|
| 9 |
+
#[cfg(unix)]
|
| 10 |
+
pub use unix::Pty;
|
| 11 |
+
#[cfg(windows)]
|
| 12 |
+
pub use windows::Pty;
|
| 13 |
+
|
| 14 |
+
pub trait PtyTrait: Read + Write + Send {
|
| 15 |
+
fn resize(&mut self, cols: u16, rows: u16) -> std::io::Result<()>;
|
| 16 |
+
fn pid(&self) -> Option<u32>;
|
| 17 |
+
}
|