Add simple comparisons in formats: #{==:a,b} and #{!=:a,b} ("a" and "b"

are expanded so can compare formats). And expand the condition to
#{?a,b,c} (the "a" part) if it doesn't work as a simple lookup.

Also add FORMAT_NOJOBS flag to disable jobs in a format.
This commit is contained in:
nicm
2017-01-09 21:03:25 +00:00
parent 561b5c6fdb
commit 844f2eacf4
3 changed files with 105 additions and 27 deletions

15
tmux.1
View File

@ -3397,6 +3397,21 @@ is enabled, or
.Ql no
if not.
.Pp
Simple comparisons may be expressed by prefixing two comma-separated
alternatives by
.Ql ==
or
.Ql !=
and a colon.
For example
.Ql #{==,#{host},myhost}
will be replaced by
.Ql 1
if running on
.Ql myhost ,
otherwise by
.Ql 0.
.Pp
A limit may be placed on the length of the resultant string by prefixing it
by an
.Ql = ,