tmux command-prompt
Open the command prompt in a client.
Syntax¶
tmux command-prompt [-1kiNTW] [-I inputs] [-p prompts] [-t target-client] [template]Behavior¶
tmux to execute commands interactively.
If template is specified, it is used as
the command. If present, -I is a comma-separated
list of the initial text for each prompt. If -p
is given, prompts is a comma-separated list of
prompts which are displayed in order; otherwise a single prompt is
displayed, constructed from template if it is
present, or ‘:’ if not.
Before the command is executed, the first occurrence of the
string ‘%%’ and all occurrences of
‘%1’ are replaced by the response
to the first prompt, all ‘%2’ are
replaced with the response to the second prompt, and so on for further
prompts. Up to nine prompt responses may be replaced
(‘%1’ to
‘%9’).
‘%%%’ is like
‘%%’ but any quotation marks are
escaped.
-1 makes the prompt only accept one
key press, in this case the resulting input is a single character.
-k is like -1 but the
key press is translated to a key name. -N makes
the prompt only accept numeric key presses. -i
executes the command every time the prompt input changes instead of when
the user exits the command prompt. -T tells
tmux that the prompt is for a target which
affects what completions are offered when Tab is
pressed; -W is similar but indicates the prompt
is for a window.
The following keys have a special meaning in the command
prompt, depending on the value of the
status-keys option:
| Function | vi | emacs |
Cancel command
prompt |
q | Escape |
Delete from
cursor to start of word |
C-w | |
Delete entire
command |
d | C-u |
Delete from
cursor to end |
D | C-k |
Execute
command |
Enter | Enter |
Get next command
from history |
Down | |
Get previous
command from history |
Up | |
Insert top
paste buffer |
p | C-y |
Look for
completions |
Tab | Tab |
Move cursor
left |
h | Left |
Move cursor
right |
l | Right |
Move cursor to
end |
$ | C-e |
Move cursor to
next word |
w | M-f |
Move cursor to
previous word |
b | M-b |
Move cursor to
start |
0 | C-a |
Transpose
characters |
C-t |
C implementation¶
Internal declarations in tmux 3.2a:
Use from a library¶
Each API describes its own defaults, errors and execution model.
tmux sources and license
Syntax comes from tmux 3.2a list-commands. See the global options for sockets and configuration, and command syntax and targets.
Behavior is taken from the tmux 3.2a manual.
Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.