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

Server

tmux(1) Server [server_manual].

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

Description#

When instantiated stores information on live, running tmux server.

Examples#

>>> server
Server(socket_name=libtmux_test...)
>>> server.sessions
[Session($1 ...)]
>>> server.sessions[0].windows
[Window(@1 1:..., Session($1 ...))]
>>> server.sessions[0].active_window
Window(@1 1:..., Session($1 ...))
>>> server.sessions[0].active_pane
Pane(%1 Window(@1 1:..., Session($1 ...)))

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

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

References#

[server_manual]

CLIENTS AND SESSIONS. openbsd manpage for TMUX(1) "The tmux server manages clients, sessions, windows and panes. Clients are attached to sessions to interact with them, either when they are created with the new-session command, or later with the attach-session command. Each session has one or more windows linked into it. Windows may be linked to multiple sessions and are made up of one or more panes, each of which contains a pseudo terminal." https://man.openbsd.org/tmux.1#CLIENTS_AND_SESSIONS. Accessed April 1st, 2018.

Discussed in Server, session, window, pane · Attaching to tmux · Python workspace internal API · Architecture , Ownership and cleanup , Socket and servers

In other ports A tmux server

Members74#

Collections and queries11#

Common operations40#

Other members23#

Inherited members24 members#

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

Esc

Type to search.

Reference preview Open reference