Struct tty::TtyServer
[−]
[src]
pub struct TtyServer { /* fields omitted */ }
Methods
impl TtyServer
[src]
fn new<T>(template: Option<&T>) -> Result<TtyServer> where
T: AsRawFd,
T: AsRawFd,
Create a new TTY with the same configuration (termios and size) as the template
TTY
fn new_client<T>(
&self,
peer: T,
sigwinch_handler: Option<Receiver<Signal>>
) -> Result<TtyClient> where
T: AsRawFd + IntoRawFd,
&self,
peer: T,
sigwinch_handler: Option<Receiver<Signal>>
) -> Result<TtyClient> where
T: AsRawFd + IntoRawFd,
Bind the peer TTY with the server TTY
The sigwinch_handler must handle the SIGWINCH signal to update the TTY window size.
This handler can be created with chan_signal::notify(&[Signal::WINCH])
from the
chan_signal crate.
Any and all threads spawned must come after the first call to chan_signal::notify!
fn get_master(&self) -> &File
Get the TTY master file descriptor usable by a TtyClient
fn take_slave(&mut self) -> Option<File>
Take the TTY slave file descriptor to manually pass it to a process
fn spawn(&mut self, cmd: Command) -> Result<Child>
Spawn a new process connected to the slave TTY