Allow specifying watchers in session files and via a command line argument

This commit is contained in:
Kovid Goyal
2020-08-23 10:41:36 +05:30
parent f4ddaacb3c
commit 392c31f5fe
9 changed files with 117 additions and 26 deletions

View File

@@ -48,6 +48,7 @@ class SpecialWindowInstance(NamedTuple):
cwd: Optional[str]
overlay_for: Optional[int]
env: Optional[Dict[str, str]]
watchers: Optional[Watchers]
def SpecialWindow(
@@ -57,9 +58,10 @@ def SpecialWindow(
cwd_from: Optional[int] = None,
cwd: Optional[str] = None,
overlay_for: Optional[int] = None,
env: Optional[Dict[str, str]] = None
env: Optional[Dict[str, str]] = None,
watchers: Optional[Watchers] = None
) -> SpecialWindowInstance:
return SpecialWindowInstance(cmd, stdin, override_title, cwd_from, cwd, overlay_for, env)
return SpecialWindowInstance(cmd, stdin, override_title, cwd_from, cwd, overlay_for, env, watchers)
def add_active_id_to_history(items: Deque[int], item_id: int, maxlen: int = 64) -> None:
@@ -333,14 +335,14 @@ class Tab: # {{{
special_window: SpecialWindowInstance,
location: Optional[str] = None,
copy_colors_from: Optional[Window] = None,
allow_remote_control: bool = False
allow_remote_control: bool = False,
) -> Window:
return self.new_window(
use_shell=False, cmd=special_window.cmd, stdin=special_window.stdin,
override_title=special_window.override_title,
cwd_from=special_window.cwd_from, cwd=special_window.cwd, overlay_for=special_window.overlay_for,
env=special_window.env, location=location, copy_colors_from=copy_colors_from,
allow_remote_control=allow_remote_control
allow_remote_control=allow_remote_control, watchers=special_window.watchers
)
def close_window(self) -> None: