# libtmux.Session.kill_window

- **Module:** libtmux.Session
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/session.py#L959
- **Page:** https://libtmux.org/reference/py/libtmux-session-kill_window/

```
libtmux.Session.kill_window(self, target_window: str | int | None = None) -> None
```

Close a tmux window, and all panes inside it, ``$ tmux kill-window``.

Kill the current window or the window at ``target-window``. removing it
from any sessions to which it is linked.

## Parameters

- `self`
- `target_window` (str | int | None) — Window to kill.

## Raises

- `libtmux.exc.LibTmuxException` — If tmux returns an error.
