From 3964309c67a683e5132662e38b5ff932af5cbeea Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sat, 23 Feb 2013 22:25:58 +0000 Subject: Add a command queue to standardize and simplify commands that call other commands and allow a command to block execution of subsequent commands. This allows run-shell and if-shell to be synchronous which has been much requested. Each client has a default command queue and commands are consumed one at a time from it. A command may suspend execution from the queue by returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() - for example run-shell does this from the callback that is fired after the job is freed. When the command queue becomes empty, command clients are automatically exited (unless attaching). A callback is also fired - this is used for nested commands in, for example, if-shell which can block execution of the client's cmdq until a new cmdq becomes empty. Also merge all the old error/info/print functions together and lose the old curclient/cmdclient distinction - a cmdq is bound to one client (or none if in the configuration file), this is a command client if c->session is NULL otherwise an attached client. --- tmux.1 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tmux.1') diff --git a/tmux.1 b/tmux.1 index 882a71f8..9f0abc31 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3468,7 +3468,11 @@ Miscellaneous commands are as follows: .Bl -tag -width Ds .It Ic clock-mode Op Fl t Ar target-pane Display a large clock. -.It Ic if-shell Ar shell-command command Op Ar command +.It Xo Ic if-shell +.Op Fl b +.Ar shell-command command +.Op Ar command +.Xc .D1 (alias: Ic if ) Execute the first .Ar command @@ -3477,19 +3481,27 @@ if returns success or the second .Ar command otherwise. +With +.Fl b , +.Ar shell-command +is run in the background. .It Ic lock-server .D1 (alias: Ic lock ) Lock each client individually by running the command specified by the .Ic lock-command option. .It Xo Ic run-shell +.Fl b .Op Fl t Ar target-pane .Ar shell-command .Xc .D1 (alias: Ic run ) Execute .Ar shell-command -in the background without creating a window. +without creating a window. +With +.Fl b , +the command is run in the background. After it finishes, any output to stdout is displayed in copy mode (in the pane specified by .Fl t -- cgit