version 1.654, 2019/05/26 17:34:45 |
version 1.655, 2019/05/27 12:16:27 |
|
|
This is called line continuation and applies both inside and outside quoted |
This is called line continuation and applies both inside and outside quoted |
strings and in comments. |
strings and in comments. |
.Pp |
.Pp |
Command arguments may be specified as strings surrounded by either single (') |
Command arguments may be specified as strings surrounded by single (') quotes, |
or double quotes ("). |
double quotes (") or braces ({}). |
.\" " |
.\" " |
This is required when the argument contains any special character. |
This is required when the argument contains any special character. |
Strings cannot span multiple lines except with line continuation. |
Single and double quoted strings cannot span multiple lines except with line |
|
continuation. |
|
Braces can span multiple lines. |
.Pp |
.Pp |
Outside of quotes and inside double quotes, these replacements are performed: |
Outside of quotes and inside double quotes, these replacements are performed: |
.Bl -dash -offset indent |
.Bl -dash -offset indent |
|
|
variable. |
variable. |
.El |
.El |
.Pp |
.Pp |
|
Braces are similar to single quotes in that the text inside is taken literally |
|
without replacements, but they can span multiple lines. |
|
They are designed to avoid the need for additional escaping when passing a group |
|
of |
|
.Nm |
|
or shell commands as an argument (for example to |
|
.Ic if-shell |
|
or |
|
.Ic pipe-pane ) . |
|
These two examples produce an identical command - note that no escaping is |
|
needed when using {}: |
|
.Bd -literal -offset indent |
|
if-shell true { |
|
display -p 'brace-dollar-foo: }$foo' |
|
} |
|
|
|
if-shell true "\en display -p 'brace-dollar-foo: }\e$foo'\en" |
|
.Ed |
|
.Pp |
|
Braces may be enclosed inside braces, for example: |
|
.Bd -literal -offset indent |
|
bind x if-shell "true" { |
|
if-shell "true" { |
|
display "true!" |
|
} |
|
} |
|
.Ed |
|
.Pp |
Environment variables may be set by using the syntax |
Environment variables may be set by using the syntax |
.Ql name=value , |
.Ql name=value , |
for example |
for example |
|
|
.Op Ar arguments |
.Op Ar arguments |
refers to a |
refers to a |
.Nm |
.Nm |
command, passed with the command and arguments separately, for example: |
command, either passed with the command and arguments separately, for example: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
bind-key F1 set-option status off |
bind-key F1 set-option status off |
.Ed |
.Ed |
.Pp |
.Pp |
Or if using |
Or passed as a single string argument in |
.Xr sh 1 : |
.Pa .tmux.conf , |
|
for example: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
$ tmux bind-key F1 set-option status off |
bind-key F1 { set-option status off } |
.Ed |
.Ed |
.Pp |
.Pp |
Example |
Example |