class libtmux.Pane(window=None, **kwargs)[source]#

Bases: libtmux.common.TmuxMappingObject, libtmux.common.TmuxRelationalObject

A tmux(1) Pane [pane_manual].

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


window (Window) –


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


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.” Accessed April 1st, 2018.

property _info(self)#

Capture text from pane.

$ tmux capture-pane to pane.

Return type:



Clear pane.

cmd(self, cmd, *args, **kwargs)[source]#

Return Server.cmd() defaulting to target_pane as target.

Send command to tmux with pane_id as target-pane.

Specifying ('-t', 'custom-target') or ('-tcustom_target') in args will override using the object’s pane_id as target.

Return type:


display_message(self, cmd, get_text=False)[source]#

$ tmux display-message to the pane.

Displays a message in target-client status line.

  • cmd (str) – Special parameters to request from pane.

  • get_text (bool, optional) – Returns only text without displaying a message in target-client status line.



Send carriage return to pane.

$ tmux send-keys send Enter to the pane.

find_where(self, attrs)[source]#

Return object on first match.

Changed in version 0.4: Renamed from .findWhere to .find_where.

formatter_prefix = pane_#
get(k[, d]) D[k] if k in D, else d.  d defaults to None.[source]#

D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.

get_by_id(self, id)[source]#

Return object based on child_id_attribute.


val (str) –

Return type:



Based on `.get()`_ from `backbone.js`_.

items() a set-like object providing a view on D's items[source]#

D.items() -> a set-like object providing a view on D’s items


Return list of keys.

pop(k[, d]) v, remove specified key and return the corresponding value.[source]#

D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() (k, v), remove and return some (key, value) pair[source]#

D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.


Reset and clear pane history.

resize_pane(self, *args, **kwargs)[source]#

$ tmux resize-pane of pane and return self.

  • target_pane (str) – target_pane, or -U,``-D``, -L, -R.

  • height (int) – resize-pane -y dimensions

  • width (int) – resize-pane -x dimensions

Return type:





Select pane. Return self.

To select a window object asynchrously. If a pane object exists and is no longer longer the current window, w.select_pane() will make p the current pane.

Return type:


send_keys(self, cmd, enter=True, suppress_history=True, literal=False)[source]#

$ tmux send-keys to the pane.

A leading space character is added to cmd to avoid polluting the user’s history.

  • cmd (str) – Text or input into pane

  • enter (bool, optional) – Send enter after sending the input, default True.

  • suppress_history (bool, optional) – Don’t add these keys to the shell history, default True.

  • literal (bool, optional) – Send keys literally, default True.

set_height(self, height)[source]#

Set height of pane.


height (int) – height of pain, in cells

set_width(self, width)[source]#

Set width of pane.


width (int) – pane width, in cells

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D[source]#

D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D

split_window(self, attach=False, vertical=True, start_directory=None, percent=None)[source]#

Split window at pane and return newly created Pane.

  • attach (bool, optional) – Attach / select pane after creation.

  • vertical (bool, optional) – split vertically

  • start_directory (str, optional) – specifies the working directory in which the new pane is created.

  • percent (int, optional) – percentage to occupy with respect to current pane

Return type:


update([E, ]**F) None.  Update D from mapping/iterable E and F.[source]#

D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values() an object providing a view on D's values[source]#

D.values() -> an object providing a view on D’s values

where(self, attrs, first=False)[source]#

Return objects matching child objects properties.


attrs (dict) – tmux properties to match values of

Return type: