libtmux Reference MCP Search
On this page

pane.Pane.kill

View as Markdown

Module
pane
Declared in
Pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
Other languages
PythonTypeScriptGoJava.NETC++Swift
kill ( self ) Result<(), Error>
method [source]
method [source]
kill

Kill the pane.

This consumes the handle. Killing a window's last pane closes the window.

Errors

Returns an error when tmux refuses the command.

In other languages Close a pane

Examples

Kill a pane:

>>> pane_1 = pane.split()
>>> pane_1 in window.panes
True
>>> pane_1.kill()
>>> pane_1 not in window.panes
True

Kill all panes except the current one:

>>> pane.window.resize(height=100, width=100)
Window(@1 1...)
>>> one_pane_to_rule_them_all = pane.split()
>>> other_panes = pane.split(
...     ), pane.split()
>>> all([p in window.panes for p in other_panes])
True
>>> one_pane_to_rule_them_all.kill(all_except=True)
>>> all([p not in window.panes for p in other_panes])
True
>>> one_pane_to_rule_them_all in window.panes
True
await pane.kill();

0 declared, 0 inherited

Esc

Type to search.