Add -B to new-pane to block and return a return code from the process.

This commit is contained in:
Michael Grant
2026-06-09 00:14:10 +02:00
parent cb237b5193
commit 37560e3716
5 changed files with 74 additions and 3 deletions

18
tmux.1
View File

@@ -3330,7 +3330,7 @@ but a different format may be specified with
.Fl F .
.Tg newp
.It Xo Ic new\-pane
.Op Fl bdefhIkPvZ
.Op Fl bBdefhIkPvZ
.Op Fl c Ar start\-directory
.Op Fl e Ar environment
.Op Fl F Ar format
@@ -3403,6 +3403,22 @@ but also sets the
option for this pane to
.Ar message .
.Pp
.Fl B
blocks until the
.Ar shell\-command
running in the new pane exits, then returns its exit status as the exit
code of the issuing client.
This makes it possible to run a command in a pane from a script and act on
its result, for example a
.Xr whiptail 1
dialog.
Only the command queue of the issuing client waits; the server and other
clients are unaffected and the new pane remains interactive.
If the pane is killed or terminated by a signal, the status is
.Li 128
plus the signal number, as for
.Ic run\-shell .
.Pp
.Fl E ,
or an empty
.Ar shell\-command ,