diff options
author | nicm <nicm> | 2017-01-09 21:28:56 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-01-09 21:28:56 +0000 |
commit | d2d984647ee0149c6fc9ec4bcd8d109679208a27 (patch) | |
tree | db0b55ea27fa0d0d60e182d6f407bdb5392e84e5 /tmux.1 | |
parent | 844f2eacf46842e18689f3b3ef464f67ea81dc61 (diff) | |
download | rtmux-d2d984647ee0149c6fc9ec4bcd8d109679208a27.tar.gz rtmux-d2d984647ee0149c6fc9ec4bcd8d109679208a27.tar.bz2 rtmux-d2d984647ee0149c6fc9ec4bcd8d109679208a27.zip |
Add %if/%endif for conditionals when parsing configuration files, the
argument is a format (the new == and != are useful).
Diffstat (limited to 'tmux.1')
-rw-r--r-- | tmux.1 | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -930,6 +930,30 @@ If is given, no error will be returned if .Ar path does not exist. +.Pp +Within a configuration file, commands may be made conditional by surrounding +them with +.Em %if +and +.Em %endif +lines. +The argument to +.Em %if +is expanded as a format and if it evaluates to false +.Ns ( Ql 0 +or empty), subsequent lines are ignored until +.Em %endif . +For example: +.Bd -literal -offset indent +%if #{==:#{host},myhost} +set -g status-style bg=red +%endif +.Ed +.Pp +Will change the status line to red if running on +.Ql myhost . +.Em %if +may not be nested. .It Ic start-server .D1 (alias: Ic start ) Start the |