# libtmux.Pane.kill

- **Module:** libtmux.Pane
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/pane.py#L1018
- **Page:** https://libtmux.org/reference/py/libtmux-pane-kill/

```
libtmux.Pane.kill(self, all_except: bool | None = None) -> None
```

Kill :class:`Pane`.

``$ tmux kill-pane``.

## Example

Kill a pane:

```python
>>> pane_1 = pane.split()
```

## Example

```python
>>> pane_1 in window.panes
True
```

## Example

```python
>>> pane_1.kill()
```

## Example

```python
>>> pane_1 not in window.panes
True
```

## Example

Kill all panes except the current one:

```python
>>> pane.window.resize(height=100, width=100)
Window(@1 1...)
```

## Example

```python
>>> one_pane_to_rule_them_all = pane.split()
```

## Example

```python
>>> other_panes = pane.split(
...     ), pane.split()
```

## Example

```python
>>> all([p in window.panes for p in other_panes])
True
```

## Example

```python
>>> one_pane_to_rule_them_all.kill(all_except=True)
```

## Example

```python
>>> all([p not in window.panes for p in other_panes])
True
```

## Example

```python
>>> one_pane_to_rule_them_all in window.panes
True
```
