summaryrefslogtreecommitdiffstats
path: root/tmux.1
diff options
context:
space:
mode:
authornicm <nicm>2014-05-13 08:08:32 +0000
committernicm <nicm>2014-05-13 08:08:32 +0000
commitb3e8d440ed0477e88232c3ba1779c67eafce3a48 (patch)
tree09e92eb59a30d393132b4da6d8cc3d3623f755b2 /tmux.1
parentb1a06ef22e54e943d733db8dcc98fe60051c93de (diff)
If multiple arguments are given to new-session, new-window,
split-window, respawn-window or respawn-pane, pass them directly to execvp() to help avoid quoting problems. One argument still goes to "sh -c" like before. Requested by many over the years. Patch from J Raynor.
Diffstat (limited to 'tmux.1')
-rw-r--r--tmux.129
1 files changed, 27 insertions, 2 deletions
diff --git a/tmux.1 b/tmux.1
index 397a228b..24dde9fa 100644
--- a/tmux.1
+++ b/tmux.1
@@ -478,12 +478,37 @@ It may be used alone to target a pane or the window containing it.
arguments are
.Xr sh 1
commands.
-These must be passed as a single item, which typically means quoting them, for
-example:
+This may be a single argument passed to the shell, for example:
.Bd -literal -offset indent
new-window 'vi /etc/passwd'
.Ed
.Pp
+Will run:
+.Bd -literal -offset indent
+/bin/sh -c 'vi /etc/passwd'
+.Ed
+.Pp
+Additionally, the
+.Ic new-window ,
+.Ic new-session ,
+.Ic split-window ,
+.Ic respawn-window
+and
+.Ic respawn-pane
+commands allow
+.Ar shell-command
+to be given as multiple arguments and executed directly (without
+.Ql sh -c ) .
+This can avoid issues with shell quoting.
+For example:
+.Bd -literal -offset indent
+$ tmux new-window vi /etc/passwd
+.Ed
+.Pp
+Will run
+.Xr vi 1
+directly without invoking the shell.
+.Pp
.Ar command
.Op Ar arguments
refers to a