Struct pty_process::blocking::Command
source · pub struct Command { /* private fields */ }Expand description
Wrapper around std::process::Command
Implementations§
source§impl Command
impl Command
sourcepub fn args<I, S>(&mut self, args: I) -> &mut Selfwhere
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
pub fn args<I, S>(&mut self, args: I) -> &mut Selfwhere I: IntoIterator<Item = S>, S: AsRef<OsStr>,
sourcepub fn env<K, V>(&mut self, key: K, val: V) -> &mut Selfwhere
K: AsRef<OsStr>,
V: AsRef<OsStr>,
pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Selfwhere K: AsRef<OsStr>, V: AsRef<OsStr>,
sourcepub fn envs<I, K, V>(&mut self, vars: I) -> &mut Selfwhere
I: IntoIterator<Item = (K, V)>,
K: AsRef<OsStr>,
V: AsRef<OsStr>,
pub fn envs<I, K, V>(&mut self, vars: I) -> &mut Selfwhere I: IntoIterator<Item = (K, V)>, K: AsRef<OsStr>, V: AsRef<OsStr>,
sourcepub fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut Self
pub fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut Self
sourcepub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self
pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Self
sourcepub fn spawn(&mut self, pts: &Pts) -> Result<Child>
pub fn spawn(&mut self, pts: &Pts) -> Result<Child>
Executes the command as a child process via
std::process::Command::spawn on the given pty. The pty will be
attached to all of stdin, stdout, and stderr of the child,
unless those file descriptors were previously overridden through calls
to stdin, stdout, or
stderr. The newly created child process will also be
made the session leader of a new session, and will have the given
pty set as its controlling terminal.
Errors
Returns an error if we fail to allocate new file descriptors for
attaching the pty to the child process, or if we fail to spawn the
child process (see the documentation for
std::process::Command::spawn), or if we fail to make the child a
session leader or set its controlling terminal.