libtmux Reference MCP Search
On this page

libtmux.Window

View as Markdown

Module
libtmux
Package
libtmux
Source
src/libtmux/window.py
class libtmux.Window
class [source]
class [source]
class libtmux.Window

tmux(1) Window [window_manual].

Holds Pane objects.

Examples

>>> window = session.new_window('My project', attach=True)
>>> window
Window(@2 2:My project, Session($... ...))

Windows have panes:

>>> window.panes
[Pane(...)]
>>> window.active_pane
Pane(...)

Relations moving up:

>>> window.session
Session(...)
>>> window.window_id == session.active_window.window_id
True
>>> window == session.active_window
True
>>> window in session.windows
True

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

>>> with session.new_window() as window:
...     pane = window.split()
...     # Do work with the pane
...     # Window will be killed automatically when exiting the context

References

[window_manual]

tmux window. openbsd manpage for TMUX(1). "Each session has one or more windows linked to it. A window occupies the entire screen and may be split into rectangular panes..." https://man.openbsd.org/tmux.1#DESCRIPTION. Accessed April 1st, 2018.

56 declared, 198 inherited

Members

Inherited members

Reached through libtmux.neo.Obj, libtmux.hooks.HooksMixin, libtmux.options.OptionsMixin.

Esc

Type to search.