Allow using boolean operators when matching windows or tabs

This commit is contained in:
Kovid Goyal
2022-04-12 19:55:20 +05:30
parent 11bc1b100c
commit ade38870a0
7 changed files with 103 additions and 84 deletions

View File

@@ -77,7 +77,8 @@ MATCH_WINDOW_OPTION = '''\
--match -m
The window to match. Match specifications are of the form:
:italic:`field:regexp`. Where field can be one of: id, title, pid, cwd, cmdline, num, env and recent.
You can use the :italic:`ls` command to get a list of windows. Note that for
You can use the :italic:`ls` command to get a list of windows. Expressions can
be :ref:`combined using Boolean operators <search_syntax>`. Note that for
numeric fields such as id, pid, recent and num the expression is interpreted as a number,
not a regular expression. The field num refers to the window position in the current tab,
starting from zero and counting clockwise (this is the same as the order in which the
@@ -93,7 +94,8 @@ MATCH_TAB_OPTION = '''\
The tab to match. Match specifications are of the form:
:italic:`field:regexp`. Where field can be one of:
id, index, title, window_id, window_title, pid, cwd, env, cmdline and recent.
You can use the :italic:`ls` command to get a list of tabs. Note that for
You can use the :italic:`ls` command to get a list of tabs. Expressions can
be :ref:`combined using Boolean operators <search_syntax>`. Note that for
numeric fields such as id, recent, index and pid the expression is interpreted as a number,
not a regular expression. When using title or id, first a matching tab is
looked for and if not found a matching window is looked for, and the tab