Struct tty_spawn::TtySpawn

source ·
pub struct TtySpawn { /* private fields */ }
Expand description

Lets you spawn processes with a TTY connected.

Implementations§

Creates a new TtySpawn for a given command.

Alternative way to construct a TtySpawn.

Takes an iterator of command and arguments. If the iterator is empty this panicks.

Panicks

If the iterator is empty, this panics.

Adds a new argument to the command.

Adds multiple arguments from an iterator.

Sets an input file for stdin.

It’s recommended that this is a named pipe and as a general recommendation this file should be opened with O_NONBLOCK.

Sets a path as input file for stdin.

Sets an output file for stdout.

Sets a path as output file for stdout.

If the truncate flag is set to true the file will be truncated first, otherwise it will be appended to.

Enables script mode.

In script mode stdout/stderr are retained as separate streams, the terminal is not opened in raw mode. Additionally some output processing is disabled so usually you will find LF retained and not converted to CLRF. This will also attempt to disable pagers and turn off ECHO intelligently in some cases.

Can be used to turn flushing off.

By default output is flushed constantly.

Can be used to turn echo off.

By default echo is turned on.

Tries to use cat as pager.

When this is enabled then processes are instructed to use cat as pager. This is useful when raw terminals are disabled in which case most pagers will break.

Can be used to turn raw terminal mode off.

By default the terminal is in raw mode but in some cases you might want to turn this off. If raw mode is disabled then pagers will not work and so will most input operations.

Spawns the application in the TTY.

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 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.