Core LibrarystableAPI Reference

Choose documentation 3

stable

Current version

stable
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

class libtmux stable

Window

tmux(1) Window [window_manual].

Source and package
Qualified name
libtmux.Window
Module
libtmux
Package
libtmux
Source
src/libtmux/window.py
Other languages
PowerShellcmdlet Juliastruct RubyLuaTypeScriptRustGoJavaC#C++SwiftKotlinScalaF#module
class libtmux.Window

Description#

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.

Discussed in Server, session, window, pane , Workspaces · Python workspace internal API · Architecture , Ownership and cleanup

In other ports A tmux window

Members56#

Parent objects2#

Collections and queries2#

  • panes property Panes contained by window.
  • search_panes method Panes in this window, optionally filtered by tmux.

Common operations30#

Other members22#

Inherited members198 members#

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

Esc

Type to search.

Reference preview Open reference