libtmux Reference MCP Search
On this page

libtmux.Pane.cmd

View as Markdown

Module
libtmux
Declared in
Pane
Package
libtmux
Source
src/libtmux/pane.py
cmd ( self , cmd : str , args : t.Any , target : str | int | None = None ) tmux_cmd
method [source]
method [source]
cmd

Execute tmux subcommand within pane context.

Automatically binds target by adding -t for object's pane ID to the command. Pass target to keyword arguments to override.

Examples

>>> pane.cmd('split-window', '-P').stdout[0]
'libtmux...:...'

From raw output to an enriched Pane object:

>>> Pane.from_pane_id(pane_id=pane.cmd(
... 'split-window', '-P', '-F#{pane_id}').stdout[0], server=pane.server)
Pane(%... Window(@... ...:..., Session($1 libtmux_...)))
Parameters
  • target ( str | int | None ) – Optional custom target override. By default, the target is the pane ID.

Returns

server.cmd

0 declared, 0 inherited

Esc

Type to search.