Panes

class libtmux.Pane

Bases: Obj, OptionsMixin, HooksMixin

tmux(1) Pane [pane_manual].

Pane instances can send commands directly to a pane, or traverse between linked tmux objects.

Examples

>>> pane
Pane(%1 Window(@1 1:..., Session($1 ...)))
>>> pane in window.panes
True
>>> pane.window
Window(@1 1:..., Session($1 ...))
>>> pane.session
Session($1 ...)

The pane can be used as a context manager to ensure proper cleanup:

>>> with window.split() as pane:
...     pane.send_keys('echo "Hello"')
...     # Do work with the pane
...     # Pane will be killed automatically when exiting the context

Notes

Changed in version 0.8: Renamed from .tmux to .cmd.

References

[pane_manual]
tmux pane. openbsd manpage for TMUX(1).

“Each window displayed by tmux may be split into one or more panes; each pane takes up a certain area of the display and is a separate terminal.”

https://man.openbsd.org/tmux.1#WINDOWS_AND_PANES. Accessed April 1st, 2018.