Allow run-shell arguments after a shell command to be expanded as #1, #2

and so on. From Rasmus Thystrup Karstensen in GitHub issue 5121.
This commit is contained in:
nicm
2026-06-01 08:27:37 +00:00
parent a9721ea268
commit 3bff7a9e62
3 changed files with 37 additions and 7 deletions

16
tmux.1
View File

@@ -7844,7 +7844,7 @@ option.
.Op Fl c Ar start\-directory
.Op Fl d Ar delay
.Op Fl t Ar target\-pane
.Op Ar shell\-command
.Op Ar shell\-command Op Ar argument ...
.Xc
.D1 Pq alias: Ic run
Execute
@@ -7861,6 +7861,20 @@ Before being executed,
is expanded using the rules specified in the
.Sx FORMATS
section.
If
.Ar argument
values are given, they are available as
.Ql #1 ,
.Ql #2
or
.Ql #{1} ,
.Ql #{2}
and so on.
For example:
.Bd -literal -offset indent
run-shell 'myscript.sh #1 #2' foo bar
.Ed
.Pp
With
.Fl b ,
the command is run in the background.