Remote control: Allow matching windows by the environment variables of their child process as well

This commit is contained in:
Kovid Goyal
2018-07-24 12:40:59 +05:30
parent 14ea69c9c7
commit ce2b3265be
4 changed files with 29 additions and 9 deletions
+10 -3
View File
@@ -152,11 +152,18 @@ class Boss:
return
if w is not None:
yield w
return
if field == 'env':
kp, vp = exp.partition('=')[::2]
if vp:
pat = tuple(map(re.compile, (kp, vp)))
else:
pat = re.compile(kp), None
else:
pat = re.compile(exp)
for window in self.all_windows:
if window.matches(field, pat):
yield window
for window in self.all_windows:
if window.matches(field, pat):
yield window
def tab_for_window(self, window):
for tab in self.all_tabs: