Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 38 variants Attach { target: Option<String>, }, Serve, RuntimeKeeper { keeper_socket: PathBuf, cols: u16, rows: u16, pixel_width: u16, pixel_height: u16, cwd: Option<PathBuf>, env: Vec<(String, OsString)>, command: Vec<String>, }, Automation { target: Option<String>, all_sessions: bool, }, Ping { payload: String, }, KillServer, NewSession { name: Option<String>, detached: bool, attach_existing: bool, session_name: Option<String>, window_name: Option<String>, cwd: Option<String>, width: Option<u16>, height: Option<u16>, print: bool, format: Option<String>, command: Vec<String>, }, ListSessions { format: Option<String>, }, HasSession { target: String, }, KillSession { target: Option<String>, force: bool, detach: bool, }, RenameSession { target: Option<String>, name: String, }, ListBuffers { target: Option<String>, attached: bool, detached: bool, }, AttachBuffer { buffer_id: u64, target: Option<String>, }, ListClients { target: Option<String>, format: Option<String>, }, DetachClient { client_id: Option<u64>, client: Option<u64>, }, SwitchClient { client_id: Option<u64>, client: Option<u64>, target: Option<String>, next: bool, previous: bool, }, Buffer { command: BufferCommand, }, Node { command: NodeCommand, }, NewWindow { target: Option<String>, title: Option<String>, cwd: Option<String>, detached: bool, print: bool, format: Option<String>, command: Vec<String>, }, ListWindows { target: Option<String>, all: bool, format: Option<String>, }, SelectWindow { target: String, }, RenameWindow { target: Option<String>, title: String, }, KillWindow { target: Option<String>, detach: bool, }, SplitWindow { target: Option<String>, side_by_side: bool, stacked: bool, horizontal: bool, vertical: bool, cwd: Option<String>, detached: bool, print: bool, format: Option<String>, help: Option<bool>, command: Vec<String>, }, ListPanes { target: Option<String>, session: bool, all: bool, format: Option<String>, }, SelectPane { target: Option<String>, last: bool, left: bool, right: bool, up: bool, down: bool, }, SetOption { pane: bool, window: bool, server: bool, global: bool, target: Option<String>, unset: bool, only_if_unset: bool, quiet: bool, name: String, value: Option<String>, }, ShowOptions { pane: bool, window: bool, server: bool, global: bool, target: Option<String>, value_only: bool, quiet: bool, name: Option<String>, }, ResizePane { target: Option<String>, sizes: Vec<u16>, left: bool, right: bool, up: bool, down: bool, zoom: bool, adjustment: Option<u16>, }, SynchronizePanes { target: Option<String>, state: Option<SwitchArg>, }, SendKeys { target: Option<String>, enter: bool, keys: Vec<String>, }, CapturePane { target: Option<String>, print: bool, start: Option<LineBound>, end: Option<LineBound>, join: bool, escapes: bool, }, KillPane { target: Option<String>, detach: bool, }, DisplayPopup {
Show 14 fields target: Option<String>, title: Option<String>, x: Option<PopupPosition>, y: Option<PopupPosition>, width: Option<PopupLength>, height: Option<PopupLength>, close_on_exit: u8, cwd: Option<String>, print: bool, format: Option<String>, no_wait: bool, no_border: bool, help: Option<bool>, command: Vec<String>,
}, KillPopup { target: Option<String>, detach: bool, }, DisplayMessage { target: Option<String>, client: Option<NonZeroU64>, print: bool, duration: Option<u32>, message: Vec<String>, }, SetEnvironment { target: Option<String>, global: bool, unset: bool, name: String, value: Option<String>, }, ShowEnvironment { target: Option<String>, global: bool, name: Option<String>, },
}

Variants§

§

Attach

Fields

§target: Option<String>
§

Serve

§

RuntimeKeeper

Fields

§keeper_socket: PathBuf
§cols: u16
§rows: u16
§pixel_width: u16
§pixel_height: u16
§command: Vec<String>
§

Automation

Fields

§target: Option<String>
§all_sessions: bool
§

Ping

Fields

§payload: String
§

KillServer

Stop the server and end every program it runs. Unlike stopping the server with a signal, nothing is left for a restarted server to reattach to or restore.

§

NewSession

Create a session, like tmux new-session: with a first window running COMMAND (or $SHELL) in -c DIR, attached unless -d. The old form, new-session NAME, creates an empty session and prints its id and name.

Fields

§name: Option<String>

The old form’s session name.

§detached: bool

Do not attach (or, from the command prompt, switch) to the session.

§attach_existing: bool

Attach to session -s if it exists instead of failing.

§session_name: Option<String>
§window_name: Option<String>

Name of the first window.

§cwd: Option<String>

Working directory of the first window; may use formats such as #{pane_current_path}. Defaults to the current directory.

§width: Option<u16>

Size to lay the session out at until a client shows it.

§height: Option<u16>
§print: bool

Print information about the session (-F, default #{session_name}:).

§format: Option<String>
§command: Vec<String>
§

ListSessions

Fields

§format: Option<String>

Print each session with this format instead of id<TAB>name.

§

HasSession

Fields

§target: String
§

KillSession

Close a session and end the programs in its panes and popups.

Fields

§target: Option<String>
§force: bool
§detach: bool

Keep the programs running as detached buffers instead.

§

RenameSession

Fields

§target: Option<String>
§name: String
§

ListBuffers

Fields

§target: Option<String>
§attached: bool
§detached: bool
§

AttachBuffer

Fields

§buffer_id: u64
§target: Option<String>
§

ListClients

Fields

§target: Option<String>

Only the clients showing this session.

§format: Option<String>

Print each client with this format instead of id<TAB>session<TAB>scope. Besides the variables of the client’s session and focused pane, it takes #{client_name} and #{client_id} (the client’s id) and #{client_session} (the name of the session it shows).

§

DetachClient

Detach a client: -c, else the client the command runs for (see switch-client).

Fields

§client_id: Option<u64>
§client: Option<u64>
§

SwitchClient

Show session -t on a client, like tmux. A window or pane target (%3, work:2, work:2.1) also makes that window current and focuses the pane. Without -c the client is the command prompt’s, else EMBERS_CLIENT, else the one showing the session of the pane the command runs in, else the only attached one. -n/-p move to the next/previous session by name.

Fields

§client_id: Option<u64>
§client: Option<u64>
§target: Option<String>
§next: bool
§previous: bool
§

Buffer

Fields

§

Node

Fields

§command: NodeCommand
§

NewWindow

Add a window to session -t running COMMAND (or $SHELL) in -c DIR (default: the current directory). Prints its number and title, or with -P the format -F (default #{session_name}:#{window_index}.#{pane_index}).

Fields

§target: Option<String>
§detached: bool

Keep the current window active.

§print: bool
§format: Option<String>
§command: Vec<String>
§

ListWindows

Fields

§target: Option<String>
§all: bool

Every session’s windows.

§format: Option<String>

Print each window with this format instead of number<TAB>active<TAB>title.

§

SelectWindow

Fields

§target: String
§

RenameWindow

Fields

§target: Option<String>
§title: String
§

KillWindow

Close a window and end the programs in its panes.

Fields

§target: Option<String>
§detach: bool

Keep the programs running as detached buffers instead.

§

SplitWindow

Split pane -t and run COMMAND (or $SHELL) in the new pane, in -c DIR (default: the current directory). -h puts the new pane to the right and -v below, like tmux; without either it goes to the right. --horizontal (a horizontal divider) is -v, and --vertical is -h. Prints the new pane’s id, or with -P the format -F (default #{session_name}:#{window_index}.#{pane_index}).

Fields

§target: Option<String>
§side_by_side: bool
§stacked: bool
§horizontal: bool
§vertical: bool
§detached: bool

Keep the split pane focused.

§print: bool
§format: Option<String>
§help: Option<bool>
§command: Vec<String>
§

ListPanes

Fields

§target: Option<String>
§session: bool

Every pane of the target’s session, not just its window’s.

§all: bool

Every pane of every session.

§format: Option<String>

Print each pane with this format instead of pane<TAB>buffer<TAB>focused<TAB>title.

§

SelectPane

Focus pane -t (default: the pane the command runs in, else the focused one); with -L/-R/-U/-D the pane next to it on that side, as the client’s focus actions find it; with -l the pane focused before the current one in the session’s current window (tmux select-pane -l).

Fields

§target: Option<String>
§last: bool
§left: bool
§right: bool
§up: bool
§down: bool
§

SetOption

Set pane -t’s option NAME to VALUE, like tmux set-option -p. Options are the pane’s buffer options (buffer set-option): @name is the option name, and remain-on-exit is the only other one. -u unsets it, -o fails if it is set, -q ignores an unknown option. Windows, sessions and the server have no options, so -p is required.

Fields

§pane: bool
§window: bool
§server: bool
§global: bool
§target: Option<String>
§unset: bool
§only_if_unset: bool
§quiet: bool
§name: String
§

ShowOptions

Print pane -t’s options, or option NAME, like tmux show-options -p: NAME VALUE lines, or with -v the values alone. -q prints nothing for an option that is not set.

Fields

§pane: bool
§window: bool
§server: bool
§global: bool
§target: Option<String>
§value_only: bool
§quiet: bool
§

ResizePane

Resize a pane like tmux: -L/-R/-U/-D [N] moves its border N cells (default 1), -Z toggles zoom, and --sizes sets the parent split’s weights directly.

Fields

§target: Option<String>
§sizes: Vec<u16>
§left: bool
§right: bool
§up: bool
§down: bool
§zoom: bool
§adjustment: Option<u16>
§

SynchronizePanes

Turn tmux-style synchronize-panes on or off for a window, or toggle it when no state is given. Prints the resulting state.

Fields

§target: Option<String>
§

SendKeys

Fields

§target: Option<String>
§enter: bool
§keys: Vec<String>
§

CapturePane

Print a pane’s text. With any of -p, -S, -E, -J or -e it works like tmux capture-pane -p: the screen, or lines -S to -E (0 is the screen’s first row, negative numbers are history, - is the start of the history or the end of the screen), -J joining wrapped lines and -e keeping colours and attributes as escape sequences. Without any, it prints the whole history and screen as before.

Fields

§target: Option<String>
§print: bool
§start: Option<LineBound>
§end: Option<LineBound>
§join: bool
§escapes: bool
§

KillPane

Close a pane and end its program.

Fields

§target: Option<String>
§detach: bool

Keep the program running as a detached buffer instead.

§

DisplayPopup

Show COMMAND (or $SHELL) in a popup over pane -t’s session and, like tmux run from a shell, wait until the popup closes, exiting with the command’s status. --no-wait returns at once and prints the popup id. Sizes and positions are cells or a percentage of the client’s view (90%); positions also take C (centre) and, for -x, R (right). The popup defaults to half the view, centred.

Fields

§target: Option<String>
§title: Option<String>

Title, which may use formats.

§x: Option<PopupPosition>
§y: Option<PopupPosition>
§width: Option<PopupLength>
§height: Option<PopupLength>
§close_on_exit: u8

Close when the command exits, as popups always do (-E); given twice (-EE), only when it exits with status 0.

§cwd: Option<String>

Working directory (tmux’s -d; -c is accepted too); may use formats such as #{pane_current_path}. Defaults to the current directory.

§print: bool

Print information about the popup once it is shown (-F, default #{popup_id}).

§format: Option<String>
§no_wait: bool

Return once the popup is shown and print its id.

§no_border: bool

Draw no frame or title: the command fills the whole popup.

§help: Option<bool>
§command: Vec<String>
§

KillPopup

Close a popup and end the programs in it.

Fields

§target: Option<String>
§detach: bool

Keep the programs running as detached buffers instead.

§

DisplayMessage

Show a message in the status line of the clients showing the target pane’s session (or of client -c) for a few seconds, like tmux. -p prints it instead. The message may use #S, #I, #W, #D, #T, #{pane_current_path} and #{pane_current_command}.

Fields

§target: Option<String>
§print: bool
§duration: Option<u32>

How long to show the message, in milliseconds.

§message: Vec<String>
§

SetEnvironment

Set an environment variable for panes created later in a session, or in every session with -g, like tmux. -u unsets it.

Fields

§target: Option<String>
§global: bool
§unset: bool
§name: String
§

ShowEnvironment

Print a session’s environment (or the global one with -g) as NAME=VALUE lines, or one variable when NAME is given.

Fields

§target: Option<String>
§global: bool

Trait Implementations§

Source§

impl Debug for Command

Source§

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

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

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more