diff --git a/src/libtmux/session.py b/src/libtmux/session.py index cc8725f98..b28cbb28f 100644 --- a/src/libtmux/session.py +++ b/src/libtmux/session.py @@ -531,8 +531,9 @@ def kill_window(self, target_window: t.Optional[t.Union[str, int]] = None) -> No Parameters ---------- - target_window : str, optional - window to kill + target_window : str, int, optional + window to kill. Stands for a window id in the format "@{id}", + if str, a window index if int, and an attached window if none. """ kill_cmd = ["kill-window"] diff --git a/tests/test_session.py b/tests/test_session.py index 70100008e..386f0d816 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -323,6 +323,7 @@ def test_new_window_with_environment_logs_warning_for_old_tmux( "Cannot set up environment" in record.msg for record in caplog.records ), "Warning missing" + @pytest.mark.parametrize( "target_window_mapper", [ @@ -334,7 +335,7 @@ def test_new_window_with_environment_logs_warning_for_old_tmux( def test_kill_window_by_id( session: Session, target_window_mapper: t.Callable[[Window], t.Optional[t.Union[int, str]]], -): +) -> None: # kill by window index session.new_window() w = session.attached_window