tmuxtmuxCLI Manual

Choose documentation 1

3.7c

tmux manual version

Latest (3.7c) 3.7c 3.2a
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

tmux command-prompt

Open the command prompt in a client.

Syntax

tmux command-prompt [-1CbeFiklN] [-I inputs] [-p prompts] [-t target-client] [-T prompt-type] [template]

Behavior

Open the command prompt in a client. This may be used from inside tmux to execute commands interactively.

If template is specified, it is used as the command. With -F, template is expanded as a format.

If -I is present, inputs 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. -l disables splitting of inputs and prompts at commas and treats them literally.

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. If -C given, panes will continue to be updated while the prompt is displayed. -i executes the command every time the prompt input changes instead of when the user exits the command prompt. -e makes BSpace cancel an empty prompt.

-T tells tmux the prompt type. This affects what completions are offered when Tab is pressed. Available types are: ‘command’, ‘search’, ‘target’ and ‘window-target’.

The following keys have a special meaning in the command prompt, depending on the value of the status-keys option:

q Escape
C-w
d C-u
D C-k
Enter Enter
Down
Up
p C-y
Tab Tab
h Left
l Right
$ C-e
w M-f
b M-b
0 C-a
C-t

With -b, the prompt is shown in the background and the invoking client does not exit until it is dismissed.

C implementation

Internal declarations in tmux 3.7c:

Use from a library

Each API describes its own defaults, errors and execution model.

tmux sources and license

Syntax comes from tmux 3.7c list-commands. See the global options for sockets and configuration, and command syntax and targets.

Behavior is taken from the tmux 3.7c manual.

Command declaration

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.
Esc

Type to search.