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

Session

tmux(1) Session [session_manual].

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

Description#

Holds Window objects.

Examples#

>>> session
Session($1 ...)
>>> session.windows
[Window(@1 ...:..., Session($1 ...)]
>>> session.active_window
Window(@1 ...:..., Session($1 ...))
>>> session.active_pane
Pane(%1 Window(@1 ...:..., Session($1 ...)))

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

>>> with server.new_session() as session:
... window = session.new_window()
... # Do work with the window
... # Session will be killed automatically when exiting the context

References#

[session_manual]

tmux session. openbsd manpage for TMUX(1). "When tmux is started it creates a new session with a single window and displays it on screen..." "A session is a single collection of pseudo terminals under the management of tmux. Each session has one or more windows linked to it." 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 session

Members44#

Parent objects1#

Collections and queries4#

  • windows property Windows contained by session.
  • panes property Panes contained by session's windows.
  • search_windows method Windows in this session, optionally filtered by tmux.
  • search_panes method Panes in this session, optionally filtered by tmux.

Common operations20#

Other members19#

Inherited members204 members#

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

Esc

Type to search.

Reference preview Open reference