From 939ca24fbe09b75c826135f781b28b46fb166d78 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 6 Feb 2024 06:38:23 -0600 Subject: [PATCH] !squash window more --- src/libtmux/window.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libtmux/window.py b/src/libtmux/window.py index ceecee5e6..31d4797aa 100644 --- a/src/libtmux/window.py +++ b/src/libtmux/window.py @@ -355,7 +355,7 @@ def set_option( suppress_warnings: t.Optional[bool] = None, append: t.Optional[bool] = None, g: t.Optional[bool] = None, - option_type: t.Optional[OptionType] = None, + option_type: t.Optional[OptionType] = OptionType.Window, ) -> "Window": """Set option for tmux window. @@ -417,9 +417,9 @@ def set_option( cmd = self.cmd( "set-option", f"-t{self.session_id}:{self.window_index}", + *flags, option, value, - *flags, ) if isinstance(cmd.stderr, list) and len(cmd.stderr): @@ -558,6 +558,8 @@ def show_option( option: str, g: bool = False, option_type: t.Optional[OptionType] = None, + include_hooks: t.Optional[bool] = None, + include_parents: t.Optional[bool] = None, ) -> t.Optional[t.Union[str, int]]: """Return option value for the target window. @@ -583,6 +585,12 @@ def show_option( assert option_type in OPTION_TYPE_FLAG_MAP tmux_args += (OPTION_TYPE_FLAG_MAP[option_type],) + if include_parents is not None and include_parents: + tmux_args += ("-A",) + + if include_hooks is not None and include_hooks: + tmux_args += ("-H",) + tmux_args += (option,) cmd = self.cmd("show-options", *tmux_args)