=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tmux.1,v retrieving revision 1.713 retrieving revision 1.714 diff -u -r1.713 -r1.714 --- src/usr.bin/tmux/tmux.1 2020/02/20 07:34:57 1.713 +++ src/usr.bin/tmux/tmux.1 2020/03/11 14:17:55 1.714 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.713 2020/02/20 07:34:57 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.714 2020/03/11 14:17:55 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 20 2020 $ +.Dd $Mdocdate: March 11 2020 $ .Dt TMUX 1 .Os .Sh NAME @@ -4107,7 +4107,7 @@ .Xr fnmatch 3 or regular expression comparison. The first argument is the pattern and the second the string to compare. -An optional third argument specifies flags: +An optional argument specifies flags: .Ql r means the pattern is a regular expression instead of the default .Xr fnmatch 3 @@ -4133,6 +4133,38 @@ ignores case. For example: .Ql #{C/r:^Start} +.Pp +Numeric operators may be performed by prefixing two comma-separated alternatives with an +.Ql e +and an operator. +An optional +.Ql f +flag may be given after the operator to use floating point numbers, otherwise integers are used. +This may be followed by a number giving the number of decimal places to use for the result. +The available operators are: +addition +.Ql + , +subtraction +.Ql - , +multiplication +.Ql * , +division +.Ql / , +and modulus +.Ql m +or +.Ql % +(note that +.Ql % +must be escaped as +.Ql %% +in formats which are also expanded by +.Xr strftime 3 ) . +For example, +.Ql #{e|*|f|4:5.5,3} +multiplies 5.5 by 3 for a result with four decimal places and +.Ql #{e|%%:7,3} +returns the modulus of 7 and 3. .Pp A limit may be placed on the length of the resultant string by prefixing it by an