libtmux Reference MCP Search
On this page

tmux.Pane.Kill

View as Markdown

Module
tmux
Declared in
Pane
Package
github.com/libtmux/libtmux-go/tmux
Source
tmux/lifecycle_kill.go
Other languages
PythonTypeScriptRustJava.NETC++Swift
Kill ( ctx : context.Context ) error
method [source]
method [source]
Kill

Kill destroys the receiver pane through its exact linked-pane target. If panes remain and the receiver was active, tmux selects another active pane. If this was the last pane, tmux also destroys the window and removes all of its winlinks. Affected sessions preserve their current selection unless the destroyed window was current, in which case they select another. A session left without windows is destroyed; Session.Kill describes how tmux handles its clients. The receiver is not refreshed. Only stderr makes a completed command a CommandError ; nonzero exits without stderr are ignored.

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.