pub struct CommandPrompt<'a> {
pub one_keypress: bool,
pub background: bool,
pub expand_as_format: bool,
pub on_input_change: bool,
pub key_name: bool,
pub numeric: bool,
pub prompt_type: Option<PromptType>,
pub for_window: bool,
pub inputs: Option<Cow<'a, str>>,
pub prompts: Option<Cow<'a, str>>,
pub target_client: Option<Cow<'a, str>>,
pub template: Option<Cow<'a, str>>,
}
Expand description
Structure for open the command prompt in a client
§Manual
tmux ^3.3:
command-prompt [-1bFikN] [-I inputs] [-p prompts] [-t target-client] [-T prompt-type] [template]
tmux ^3.2:
command-prompt [-1ikNTW] [-I inputs] [-p prompts] [-t target-client] [template]
tmux ^3.1:
command-prompt [-1ikN] [-I inputs] [-p prompts] [-t target-client] [template]
tmux ^3.0:
command-prompt [-1Ni] [-I inputs] [-p prompts] [-t target-client] [template]
tmux ^2.4:
command-prompt [-1i] [-I inputs] [-p prompts] [-t target-client] [template]
tmux ^1.5:
command-prompt [-I inputs] [-p prompts] [-t target-client] [template]
tmux ^1.0:
command-prompt [-p prompts] [-t target-client] [template]
tmux ^0.8:
command-prompt [-t target-client] [template]
Fields§
§one_keypress: bool
[-1]
- makes the prompt only accept one key press
background: bool
[-b]
- the prompt is shown in the background and the invoking client does not exit until it is dismissed
expand_as_format: bool
[-F]
-
on_input_change: bool
[-i]
execute the command every time the prompt input changes
key_name: bool
[-k]
- the key press is translated to a key name
numeric: bool
[-N]
- makes the prompt only accept numeric key presses
prompt_type: Option<PromptType>
[-T prompt-type]
- tells tmux the prompt type. This affects what completions are offered when Tab is pressed
for_window: bool
[-W]
- indicates the prompt is for a window.
inputs: Option<Cow<'a, str>>
[-I inputs]
- comma-separated list of the initial text for each prompt
prompts: Option<Cow<'a, str>>
[-p prompts]
- prompts is a comma-separated list of prompts which are displayed in order
target_client: Option<Cow<'a, str>>
[-t target-client]
- target-client
template: Option<Cow<'a, str>>
[template]
- template
Implementations§
Source§impl<'a> CommandPrompt<'a>
impl<'a> CommandPrompt<'a>
pub fn new() -> Self
Sourcepub fn one_keypress(self) -> Self
pub fn one_keypress(self) -> Self
[-1]
makesthe prompt only accept one key press
Sourcepub fn on_input_change(self) -> Self
pub fn on_input_change(self) -> Self
[-i]
execute the command every time the prompt input changes
Sourcepub fn prompt_type(self, prompt_type: PromptType) -> Self
pub fn prompt_type(self, prompt_type: PromptType) -> Self
[-T prompt-type]
Sourcepub fn for_window(self) -> Self
pub fn for_window(self) -> Self
[-W]
- indicates the prompt is for a window.
Sourcepub fn inputs<S: Into<Cow<'a, str>>>(self, inputs: S) -> Self
pub fn inputs<S: Into<Cow<'a, str>>>(self, inputs: S) -> Self
[-I inputs]
- comma-separated list of the initial text for each prompt
Sourcepub fn prompts<S: Into<Cow<'a, str>>>(self, prompts: S) -> Self
pub fn prompts<S: Into<Cow<'a, str>>>(self, prompts: S) -> Self
[-p prompts]
- prompts is a comma-separated list of prompts which are displayed in order
Sourcepub fn target_client<S: Into<Cow<'a, str>>>(self, target_client: S) -> Self
pub fn target_client<S: Into<Cow<'a, str>>>(self, target_client: S) -> Self
[-t target-client]
- target-client
pub fn build(self) -> TmuxCommand<'a>
Trait Implementations§
Source§impl<'a> Clone for CommandPrompt<'a>
impl<'a> Clone for CommandPrompt<'a>
Source§fn clone(&self) -> CommandPrompt<'a>
fn clone(&self) -> CommandPrompt<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more