pub struct TmuxCommand<'a> {
pub envs: Option<Vec<(Cow<'a, str>, Cow<'a, str>)>>,
pub name: Option<Cow<'a, str>>,
pub alias: Option<Cow<'a, str>>,
pub flags: Option<Vec<Cow<'a, str>>>,
pub flags_short: Option<String>,
pub args: Option<Vec<Cow<'a, str>>>,
pub subcommands: Option<TmuxCommands<'a>>,
pub separator: Option<&'a str>,
pub flags_args_separator: Option<&'a str>,
pub combine_short_flags: bool,
pub use_alias: bool,
}
Expand description
Standard tmux command line arguments syntax:
tmux [-2CluvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]]
Fields§
§envs: Option<Vec<(Cow<'a, str>, Cow<'a, str>)>>
environment variables
name: Option<Cow<'a, str>>
command name
alias: Option<Cow<'a, str>>
command alias
flags: Option<Vec<Cow<'a, str>>>
flags ([-a] [-b] [-c]
)
flags_short: Option<String>
short flags ([-a] [-b] [-c]
)
args: Option<Vec<Cow<'a, str>>>
arguments: long flags, options, parameters ([--longflag] [-o opt] [param]
)
subcommands: Option<TmuxCommands<'a>>
subcommands list
separator: Option<&'a str>
separator between command and it’s flags, args, subcommand (“ “)
flags_args_separator: Option<&'a str>
flags, args separator (usually double dash --
)
combine_short_flags: bool
combine multiple single flags into flags line (-f -a
= -fa
)
use_alias: bool
use command alias instead of name (new-session
= new
)
Implementations§
Source§impl<'a> TmuxCommand<'a>
impl<'a> TmuxCommand<'a>
Sourcepub fn new_full<S: Into<Cow<'a, str>>>(name: S) -> Self
pub fn new_full<S: Into<Cow<'a, str>>>(name: S) -> Self
Create new Cmd
structure, initialize both not_combine_short_flags
and not_use_alias
fields with true
. Command will not combine flags (separate flags will be used instead),
and not use alias (command name will be used instead)
Sourcepub fn with_alias<S: Into<Cow<'a, str>>>(alias: S) -> Self
pub fn with_alias<S: Into<Cow<'a, str>>>(alias: S) -> Self
Create and set alias
field
pub fn with_cmds(cmd_list: TmuxCommands<'a>) -> Self
Sourcepub fn env<T, U>(&mut self, key: T, value: U) -> &mut Self
pub fn env<T, U>(&mut self, key: T, value: U) -> &mut Self
Add an environment variable to Cmd.env
Sourcepub fn push_flag<S: Into<Cow<'a, str>>>(&mut self, flag: S) -> &mut Self
pub fn push_flag<S: Into<Cow<'a, str>>>(&mut self, flag: S) -> &mut Self
push a single flag (-x
)
pub fn push_flag_short(&mut self, flag: char) -> &mut Self
Sourcepub fn push_option<U, V>(&mut self, key: U, option: V) -> &mut Self
pub fn push_option<U, V>(&mut self, key: U, option: V) -> &mut Self
push an option, flag and value (-x <VALUE>
)
Sourcepub fn push_param<S: Into<Cow<'a, str>>>(&mut self, param: S) -> &mut Self
pub fn push_param<S: Into<Cow<'a, str>>>(&mut self, param: S) -> &mut Self
push a single parameter (<VALUE>
)
pub fn push_cmd(&mut self, cmd: TmuxCommand<'a>) -> &mut Self
pub fn push_cmds(&mut self, cmd_list: TmuxCommands<'a>) -> &mut Self
pub fn arg<T, U>(&mut self, flag: T, opt: U) -> &mut Self
pub fn opt<T, U>(&mut self, short: T, opt: U) -> &mut Self
pub fn param<T: Into<Cow<'a, str>>>(&mut self, param: T) -> &mut Self
Sourcepub fn combine_short_flags(&mut self) -> &mut Self
pub fn combine_short_flags(&mut self) -> &mut Self
Set Cmd.combine_short_flags
to true
pub fn not_combine_short_flags(&mut self) -> &mut Self
pub fn combine_short_flags_ext(&mut self, state: bool) -> &mut Self
pub fn not_use_alias(&mut self) -> &mut Self
pub fn use_alias_ext(&mut self, state: bool) -> &mut Self
Sourcepub fn to_command(self) -> Command
pub fn to_command(self) -> Command
Transform Cmd
into std::process::Command
Source§impl<'a> TmuxCommand<'a>
impl<'a> TmuxCommand<'a>
pub fn add_command(self, command: TmuxCommand<'a>) -> Self
Sourcepub fn into_tmux(self) -> Tmux<'a>
pub fn into_tmux(self) -> Tmux<'a>
create Tmux
from TmuxCommand
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Buffers” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Buffers” listed below (man tmux)
pub fn choose_buffer() -> ChooseBuffer<'a>
pub fn clear_history() -> ClearHistory<'a>
pub fn delete_buffer() -> DeleteBuffer<'a>
pub fn list_buffers() -> ListBuffers<'a>
pub fn load_buffer() -> LoadBuffer<'a>
pub fn paste_buffer() -> PasteBuffer<'a>
pub fn save_buffer() -> SaveBuffer<'a>
pub fn set_buffer() -> SetBuffer<'a>
pub fn show_buffer() -> ShowBuffer<'a>
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Clients and Sessions” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Clients and Sessions” listed below (man tmux)
pub fn attach_session() -> AttachSession<'a>
pub fn detach_client() -> DetachClient<'a>
pub fn has_session() -> HasSession<'a>
pub fn kill_server() -> KillServer
pub fn kill_session() -> KillSession<'a>
pub fn list_clients() -> ListClients<'a>
pub fn list_commands() -> ListCommands<'a>
pub fn list_sessions() -> ListSessions<'a>
pub fn lock_client() -> LockClient<'a>
pub fn lock_session() -> LockSession<'a>
pub fn new_session() -> NewSession<'a>
pub fn refresh_client() -> RefreshClient<'a>
pub fn rename_session() -> RenameSession<'a>
pub fn show_messages() -> ShowMessages<'a>
pub fn source_file() -> SourceFile<'a>
pub fn start_server() -> StartServer
pub fn suspend_client() -> SuspendClient<'a>
pub fn switch_client() -> SwitchClient<'a>
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Global and session environment” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Global and session environment” listed below (man tmux)
pub fn set_environment() -> SetEnvironment<'a>
pub fn show_environment() -> ShowEnvironment<'a>
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Hooks” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Hooks” listed below (man tmux)
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Key Bindings” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Key Bindings” listed below (man tmux)
pub fn bind_key() -> BindKey<'a>
pub fn list_keys() -> ListKeys<'a>
pub fn send_keys() -> SendKeys<'a>
pub fn send_prefix() -> SendPrefix<'a>
pub fn unbind_key() -> UnbindKey<'a>
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Miscellaneous” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Miscellaneous” listed below (man tmux)
pub fn clock_mode() -> ClockMode<'a>
pub fn if_shell() -> IfShell<'a>
pub fn lock_server() -> LockServer
pub fn run_shell() -> RunShell<'a>
pub fn wait_for() -> WaitFor<'a>
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Options” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Options” listed below (man tmux)
pub fn set_option() -> SetOption<'a>
pub fn set_window_option() -> SetWindowOption<'a>
pub fn show_options() -> ShowOptions<'a>
pub fn show_window_options() -> ShowWindowOptions<'a>
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Status line” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Status line” listed below (man tmux)
pub fn clear_prompt_history() -> ClearPromptHistory<'a>
pub fn command_prompt() -> CommandPrompt<'a>
pub fn confirm_before() -> ConfirmBefore<'a>
pub fn display_message() -> DisplayMessage<'a>
pub fn display_popup() -> DisplayPopup<'a>
pub fn show_prompt_history() -> ShowPromptHistory<'a>
Source§impl<'a> TmuxCommand<'a>
All functions from man tmux “Windows and Panes” listed below
(man tmux)
impl<'a> TmuxCommand<'a>
All functions from man tmux “Windows and Panes” listed below (man tmux)
pub fn break_pane() -> BreakPane<'a>
pub fn capture_pane() -> CapturePane<'a>
pub fn choose_client() -> ChooseClient<'a>
pub fn choose_tree() -> ChooseTree<'a>
pub fn copy_mode() -> CopyMode<'a>
pub fn display_panes() -> DisplayPanes<'a>
pub fn find_window() -> FindWindow<'a>
pub fn join_pane() -> JoinPane<'a>
pub fn kill_pane() -> KillPane<'a>
pub fn kill_window() -> KillWindow<'a>
pub fn last_pane() -> LastPane<'a>
pub fn last_window() -> LastWindow<'a>
pub fn link_window() -> LinkWindow<'a>
pub fn list_panes() -> ListPanes<'a>
pub fn list_windows() -> ListWindows<'a>
pub fn move_pane() -> MovePane<'a>
pub fn move_window() -> MoveWindow<'a>
pub fn new_window() -> NewWindow<'a>
pub fn next_layout() -> NextLayout<'a>
pub fn pipe_pane() -> PipePane<'a>
pub fn previous_layout() -> PreviousLayout<'a>
pub fn previous_window() -> PreviousWindow<'a>
pub fn rename_window() -> RenameWindow<'a>
pub fn resize_pane() -> ResizePane<'a>
pub fn resize_window() -> ResizeWindow<'a>
pub fn respawn_window() -> RespawnWindow<'a>
pub fn rotate_window() -> RotateWindow<'a>
pub fn select_layout() -> SelectLayout<'a>
pub fn select_pane() -> SelectPane<'a>
pub fn select_window() -> SelectWindow<'a>
pub fn split_window() -> SplitWindow<'a>
pub fn swap_pane() -> SwapPane<'a>
pub fn swap_window() -> SwapWindow<'a>
pub fn unlink_window() -> UnlinkWindow<'a>
Trait Implementations§
Source§impl<'a> Clone for TmuxCommand<'a>
impl<'a> Clone for TmuxCommand<'a>
Source§fn clone(&self) -> TmuxCommand<'a>
fn clone(&self) -> TmuxCommand<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more