diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-19 10:39:50 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-19 10:39:50 +0000 |
commit | 3f4418d84dd8865f1bba410fc796acb53277abbf (patch) | |
tree | 8e77d873046cb99f6d4cbd9a8a1528a5d6f575c3 /tmux.1 | |
parent | 036de0c5e44ba374707e86b313e4f848488ebdea (diff) | |
download | rtmux-3f4418d84dd8865f1bba410fc796acb53277abbf.tar.gz rtmux-3f4418d84dd8865f1bba410fc796acb53277abbf.tar.bz2 rtmux-3f4418d84dd8865f1bba410fc796acb53277abbf.zip |
Extend command-prompt with a -p option which is a comma-separated list of one
or more prompts to present in order.
The responses to the prompt are replaced in the template string: %% are
replaced in order, so the first prompt replaces the first %%, the second
replaces the second, and so on. In addition, %1 up to %9 are replaced with the
responses to the first the ninth prompts
The default template is "%1" so the response to the first prompt is processed
as a command.
Note that this changes the behaviour for %% so if there is only one prompt,
only the first %% will be replaced. Templates such as "neww -n '%%' 'ssh %%'"
should be changed to "neww -n '%1' 'ssh %1'".
From Tiago Cunha.
Diffstat (limited to 'tmux.1')
-rw-r--r-- | tmux.1 | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -1662,6 +1662,7 @@ session option. Commands related to the status line are as follows: .Bl -tag -width Ds .It Xo Ic command-prompt +.Op Fl p Ar prompts .Op Fl t Ar target-client .Op Ar template .Xc @@ -1671,8 +1672,30 @@ This may be used from inside to execute commands interactively. If .Ar template -is specified, it is used as the command; any %% in the template will be -replaced by what is entered at the prompt. +is specified, it is used as the command. +If +.Fl p +is given, +.Ar prompts +is a comma-separated list of prompts which are displayed in order; otherwise +a single prompt is displayed, constructed from +.Ar template +if it is present, or +.Ql \&: +if not. +Before the command is executed, the first occurrence of the string +.Ql %% +and all occurences of +.Ql %1 +are replaced by the response to the first prompt, the second +.Ql %% +and all +.Ql %2 +are replaced with the response to the second prompt, and so on for further +prompts. Up to nine prompt responses may be replaced +.Ns ( Ql %1 +to +.Ns Ql %9 ) . .It Xo Ic confirm-before .Op Fl t Ar target-client .Ar command @@ -1926,6 +1949,7 @@ Creating new key bindings: .Bd -literal -offset indent bind-key b set-option status bind-key / command-prompt "split-window 'exec man %%'" +bind-key S command-prompt "new-window -n %1 'ssh %1'" .Ed .Sh SEE ALSO .Xr pty 4 |