Windows

class libtmux.Window
Parameters:

session (Session)

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.