pub struct PtyCommand { /* private fields */ }
Available on crate feature portable-pty only.
Expand description

Command to spawn in a pseudo-terminal (PTY).

Examples

Since shell spawning is performed in a generic way, PtyCommand can be used as a drop-in replacement for Command:

let transcript = Transcript::from_inputs(
    &mut ShellOptions::new(PtyCommand::default()),
    vec![UserInput::command(r#"echo "Hello world!""#)],
)?;
// do something with `transcript`...

Implementations

Creates a new command based on the executable.

This uses a reasonable default for the PTY size (19 character rows, 80 columns).

Sets the size of the PTY in characters.

Adds a command argument.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Sets the current directory.

Sets an environment variable.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Spawned shell process.

Reader of the shell output.

Writer to the shell input.

Spawns a shell process. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.