pub struct Tmux<'a> {
Show 18 fields pub colours256: bool, pub control_mode: bool, pub disable_echo: bool, pub no_daemon: bool, pub login_shell: bool, pub no_start: bool, pub force_utf8: bool, pub verbose_logging: bool, pub version: bool, pub shell_command: Option<Cow<'a, str>>, pub file: Option<Cow<'a, str>>, pub socket_name: Option<Cow<'a, str>>, pub socket_path: Option<Cow<'a, str>>, pub features: Option<Cow<'a, str>>, pub command: Option<TmuxCommands<'a>>, pub stdin: Option<StdIO>, pub stdout: Option<StdIO>, pub stderr: Option<StdIO>,
}
Expand description

man tmux

§Manual

tmux ^3.2:

tmux [-2CDluvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [-T features] [command [flags]]

tmux ^2.1:

tmux [-2CluvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]]

tmux ^1.9:

tmux [-2lCquvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]]

tmux ^1.8:

tmux [-28lCquvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]

tmux ^1.4:

tmux [-28lquvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]]

tmux ^1.1:

tmux [-28lquv] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]]

tmux ^1.0:

tmux [-28dlqUuv] [-f file] [-L socket-name] [-S socket-path] [command [flags]]

tmux ^0.9:

tmux [-28dqUuv] [-f file] [-L socket-name] [-S socket-path] [command [flags]]

tmux ^0.8:

tmux [-28dqUuVv] [-f file] [-L socket-name] [-S socket-path] [command [flags]]

Fields§

§colours256: bool

[-2] - Force tmux to assume the terminal supports 256 colours

§control_mode: bool

[-C] - Start in control mode

§disable_echo: bool

[-CC] - Disable echo

§no_daemon: bool

[-D] - Do not start the tmux server as a daemon. This also turns the exit-empty option off. With -D, command may not be specified.

§login_shell: bool

[-l] - Behave as a login shell

§no_start: bool

[-N] - Do not start the server even if the command would normally do so (for example new-session or start-server).

§force_utf8: bool

[-u] - Write UTF-8 output to the terminal

§verbose_logging: bool

[-v] - Request verbose logging

§version: bool

[-V] - Report the tmux version

§shell_command: Option<Cow<'a, str>>

[-c shell-command] - Execute shell-command using the default shell

§file: Option<Cow<'a, str>>

[-f file] - Specify an alternative configuration file

§socket_name: Option<Cow<'a, str>>

[-L socket-name] - Allow a different socket name to be specified

§socket_path: Option<Cow<'a, str>>

[-S socket-path] - Specify a full alternative path to the server socket

§features: Option<Cow<'a, str>>

[-T features] - Set terminal features for the client

§command: Option<TmuxCommands<'a>>

[command]

§stdin: Option<StdIO>

(1)

§stdout: Option<StdIO>

(2)

§stderr: Option<StdIO>

(3)

Implementations§

source§

impl<'a> Tmux<'a>

source

pub fn new() -> Self

source

pub fn colours256(self) -> Self

[-2] - Force tmux to assume the terminal supports 256 colours

source

pub fn control_mode(self) -> Self

[-C] - Start in control mode

source

pub fn disable_echo(self) -> Self

[-CC] - Disable echo

source

pub fn no_daemon(self) -> Self

[-D] - Do not start the tmux server as a daemon. This also turns the exit-empty option off. With -D, command may not be specified.

source

pub fn login_shell(self) -> Self

[-l] - Behave as a login shell

source

pub fn no_start(self) -> Self

[-N] - Do not start the server even if the command would normally do so (for example new-session or start-server).

source

pub fn force_utf8(self) -> Self

[-u] - Write UTF-8 output to the terminal

source

pub fn verbose_logging(self) -> Self

[-v] - Request verbose logging

source

pub fn version(self) -> Self

[-V] - Report the tmux version

source

pub fn shell_command<S: Into<Cow<'a, str>>>(self, shell_command: S) -> Self

[-c shell-command] - Execute shell-command using the default shell

source

pub fn file<S: Into<Cow<'a, str>>>(self, file: S) -> Self

[-f file] - Specify an alternative configuration file

source

pub fn socket_name<S: Into<Cow<'a, str>>>(self, socket_name: S) -> Self

[-L socket-name] - Allow a different socket name to be specified

source

pub fn socket_path<S: Into<Cow<'a, str>>>(self, socket_path: S) -> Self

[-S socket-path] - Specify a full alternative path to the server socket

source

pub fn features<S: Into<Cow<'a, str>>>(self, features: S) -> Self

[-T features] - Set terminal features for the client

source

pub fn command<T: Into<TmuxCommand<'a>>>(self, command: T) -> Self

[command]

source

pub fn build(self) -> TmuxCommand<'a>

source

pub fn into_command(self) -> Command

source

pub fn with_command<T: Into<TmuxCommand<'a>>>(command: T) -> Self

source

pub fn with_commands(commands: TmuxCommands<'a>) -> Self

source

pub fn add_command<T: Into<TmuxCommand<'a>>>(self, command: T) -> Self

source

pub fn commands(self, commands: TmuxCommands<'a>) -> Self

source§

impl<'a> Tmux<'a>

source

pub fn output(self) -> Result<TmuxOutput, Error>

execute tmux process, wait for output, return output

by default:

  • stdin is inherited (differs from std::process::Command, where it is not inherited by default) prevents from immediately closing tmux after attempt to read from stdin
  • stdout is inherited
  • stderr is inherited
source

pub fn spawn(self) -> Result<Child, Error>

spawn tmux process, return process handle as child by default:

  • stdin is inherited
  • stdout is inherited
  • stderr is inherited
source

pub fn status(self) -> Result<ExitStatus, Error>

spawn tmux process, return status result of the command execution by default:

  • stdin is inherited
  • stdout is inherited
  • stderr is inherited
source

pub fn stdin(self, stdin: Option<StdIO>) -> Self

set stdin

source

pub fn stdout(self, stdout: Option<StdIO>) -> Self

set stdout

source

pub fn stderr(self, stderr: Option<StdIO>) -> Self

set stderr

Trait Implementations§

source§

impl<'a> Clone for Tmux<'a>

source§

fn clone(&self) -> Tmux<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for Tmux<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Default for Tmux<'a>

source§

fn default() -> Tmux<'a>

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

impl<'a> From<Tmux<'a>> for Command

source§

fn from(item: Tmux<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> Hash for Tmux<'a>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> Ord for Tmux<'a>

source§

fn cmp(&self, other: &Tmux<'a>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<'a> PartialEq for Tmux<'a>

source§

fn eq(&self, other: &Tmux<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialOrd for Tmux<'a>

source§

fn partial_cmp(&self, other: &Tmux<'a>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a> Eq for Tmux<'a>

source§

impl<'a> StructuralPartialEq for Tmux<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Tmux<'a>

§

impl<'a> Send for Tmux<'a>

§

impl<'a> Sync for Tmux<'a>

§

impl<'a> Unpin for Tmux<'a>

§

impl<'a> UnwindSafe for Tmux<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.