API reference
Browse the Python types and operations for working with tmux. Start with the core objects below, or search for a type or member.
Server 1 type, 2 functions and constants
tmux(1) Server [server_manual].
Wrap fetch_objs : treat a not-yet-started server as empty.
Return True if the error indicates the tmux server is not running.
Session 1 type, 2 functions and constants
tmux(1) Session [session_manual].
Raise exception session name invalid, modeled after tmux function.
Window 2 types, 3 functions and constants
tmux(1) Window [window_manual].
Used for adjustment in Session.new_window() .
Pane 2 types, 2 functions and constants
tmux(1) Pane [pane_manual].
Used for adjustment in Pane.split() .
Client 1 type
tmux(1) Client [client_manual].
Hooks 1 type, 3 functions and constants
Mixin for manager scoped hooks in tmux.
Options 2 types
Scope used with set-option and show-option(s) commands.
Mixin for managing tmux options based on scope.
Options — Functions 6 functions and constants
Convert raw option strings to python types.
Recursively convert values to python types via convert_value .
Explode flat, naive options dict's option arrays.
Explode arrayed option's complex values.
Raise exception if error in option command found.
Process subprocess.stdout options or hook output to flat, naive, untyped dict.
Options — Constants and variables 11 functions and constants
Layout and geometry 1 type, 1 function or constant
Used for adjustment in resize_window, resize_pane.
Environment 1 type
Mixin for manager session and server level environment variables in tmux.
Versions 13 functions and constants
Return a synthetic version string when tmux lacks -V.
Return libtmux version is a PEP386 compliant format.
Return tmux version.
Return the tmux version string verbatim, preserving letter suffixes.
Return True if tmux version greater than minimum.
Return True if tmux version greater or equal to minimum.
Return True if tmux version less than minimum.
Return True if tmux version less or equal to minimum.
Return True if tmux meets version requirement. Version >= 3.2a.
Return True if tmux version installed.
Commands 3 types
Command protocol for tmux command.
Command mixin for tmux command.
Run any tmux(1) command through subprocess.
Formats 21 functions and constants
Minimum tmux version that registers each format token.
Format-token scopes a given tmux list-* subcommand can resolve.
Pick the winlink row tmux would select.
Return True if tmux failed because the -t target does not exist.
Convert a tmux version string into a comparable LooseVersion.
Resolve a format token's scope from its name.
Fetch the single list-* row whose obj_key equals obj_id.
Fetch a listing of raw data from a tmux command.
Return field names and tmux format string filtered by scope and version.
Parse a tmux -F line into a dict keyed by Obj field name.
Queries 1 function or constant
Return the raw tmux -V version token, letter suffix intact.
Errors 18 types, 2 functions and constants
Internal signal: this tmux predates the -V flag (pre-1.7).
Base Exception for libtmux Errors.
Raised when a deprecated function, method, or parameter is used.
Application binary for tmux not found.
Raised when the process is not running inside a tmux pane.
A lookup expected one object and matched none.
A lookup expected one object and matched several.
tmux has no object with the id that was asked for.
Raised if tmux below the minimum version to use libtmux.
Root error for any error involving invalid, ambiguous or bad options.
Option unknown to tmux show-option(s) or show-window-option(s).
Unknown color option.
Option invalid to tmux.
Option that could potentially match more than one.
Function timed out without meeting condition.
Error unpacking variable.
If adjustment_direction is set, adjustment must be set.
Requires digit (int or str digit) or a percentage.
Render a QueryList.get lookup back as key=value text.
Raise LibTmuxException tagged with the tmux subcommand on stderr.
Errors — Session 2 types
Session does not exist in the server.
Disallowed session name for tmux (empty, contains periods or colons).
Errors — Window 5 types
Any type of window related error.
Multiple active windows.
No active window found.
No windows exist for object.
ValueError for libtmux.Window.resize_window.
Errors — Pane 3 types
Testing utilities 13 functions and constants
Kill the tmux daemon on socket_name and unlink the socket file.
Clear out any unnecessary environment variables that could interrupt tests.
Return fixture for .tmux.conf configuration.
Return ControlMode context manager factory.
Temporary /home/ path.
Return default username to set for user_path fixture.
Return new, temporary libtmux.Server .
Return new, temporary libtmux.Session .
Return default session creation parameters.
Create a temporary tmux server that cleans up after itself.
Ensure and return temporary user directory.
Suppress ZSH default message.
Internal 7 types, 51 functions and constants
tmux hooks data structure.
Context manager that spawns a tmux control-mode client.
Skip default fields in dataclass object representation.
Filter list of object/dictionaries. For small, local datasets.
Support non-sequential indexes while maintaining list -like behavior.
Environment variable tmux exports with socket_path,server_pid,session_id.
Environment variable tmux exports with the pane's id, e.g. %3.
Fetch values in objects and keys, supported nested data.
Return the pane id recorded in $TMUX_PANE.
Check if field lookup key, e.g. "my__path__contains" has comparator, return val.
Return env, defaulting to the live process environment.
Return the tmux socket path recorded in $TMUX.
Internal — Options 5 types
Container for tmux server options.
Container for tmux session options.
Container for tmux window options.
Container for tmux pane options.
Container for all tmux options (server, session, window, and pane).
Other 2 types, 2 functions and constants
Dataclass of generic tmux object.
By module 73 modules
-
libtmux_mcp 1
-
libtmux_mcp.models 24
- Buffer
Content - Buffer
Ref - Capture
Since Result - Environment
Result - Environment
Set Result - Hook
Entry - Hook
List Result - Option
Result - Option
Set Result - Pane
Content Match - Pane
Info - Pane
Snapshot - Run
Command Result - Search
Panes Result - Send
Keys Batch Result - Send
Keys Operation - Send
Keys Operation Result - Server
Info - Session
Info - Tool
Call Batch Result - Tool
Call Operation - Tool
Call Operation Result - Wait
For Text Result - Window
Info
- Buffer
-
libtmux_mcp.prompts 2
-
libtmux_mcp.resources 1
-
libtmux_mcp.server 4
-
libtmux_mcp.tools 1
-
libtmux.__about__ 4
-
libtmux.client 1
-
libtmux.common 25
- Cmd
Mixin - Cmd
Protocol - Environment
Mixin - tmux
_cmd - logger
- Pane
Dict - Session
Dict - TMUX
_MAX _VERSION - TMUX
_MIN _VERSION - Window
Dict - Window
Option Dict - _Tmux
Version Unavailable - _no
_version _flag _fallback - _query
_version - get
_libtmux _version - get
_version - get
_version _str - has
_gt _version - has
_gte _version - has
_lt _version - has
_lte _version - has
_minimum _version - has
_version - raise
_if _stderr - session
_check _name
- Cmd
-
libtmux.exc 28
- Tmux
Object Does Not Exist - Unknown
Color Option - Adjustment
Direction Requires Adjustment - Ambiguous
Option - Bad
Session Name - Deprecated
Error - Invalid
Option - Lib
Tmux Exception - Multiple
Active Windows - Multiple
Objects Returned - No
Active Window - Not
Inside Tmux - No
Windows Exist - Object
Does Not Exist - Option
Error - Pane
Adjustment Direction Requires Adjustment - Pane
Error - Pane
Not Found - Requires
Digit Or Percentage - Tmux
Command Not Found - Tmux
Session Exists - Unknown
Option - Variable
Unpacking Error - Version
Too Low - Wait
Timeout - Window
Adjustment Direction Requires Adjustment - Window
Error - _format
_query
- Tmux
-
libtmux.formats 5
-
libtmux.hooks 4
-
libtmux.options 18
-
libtmux.pane 1
-
libtmux.pytest_plugin 14
-
libtmux.server 3
-
libtmux.session 1
-
libtmux.window 1
-
tmuxp.cli 7
-
tmuxp.exc 17
- Active
Session Missing Workspace Exception - Before
Load Script Error - Before
Load Script Not Exists - Empty
Workspace Exception - Invalid
Workspace Builder - Invalid
Workspace Builder Option - Pane
Not Found - Session
Missing Workspace Exception - Session
Not Found - Window
Not Found - Workspace
Builder Import Error - Workspace
Builder Not Found - Workspace
Builder Path Error - Tmuxp
Exception - Tmuxp
Plugin Exception - Workspace
Builder Error - Workspace
Error
- Active
-
tmuxp.types 1
-
libtmux_mcp.prompts.recipes 4
-
libtmux_mcp.resources.hierarchy 2
-
libtmux_mcp.tools.batch_tools 3
-
libtmux_mcp.tools.buffer_tools 6
-
libtmux_mcp.tools.env_tools 3
-
libtmux_mcp.tools.hook_tools 3
-
libtmux_mcp.tools.option_tools 3
-
libtmux_mcp.tools.pane_tools 23
- capture
_pane - capture
_since - clear
_pane - display
_message - enter
_copy _mode - exit
_copy _mode - find
_pane _by _position - get
_pane _info - kill
_pane - paste
_text - pipe
_pane - register
- resize
_pane - respawn
_pane - run
_command - search
_panes - select
_pane - send
_keys - send
_keys _batch - set
_pane _title - snapshot
_pane - swap
_pane - wait
_for _text
- capture
-
libtmux_mcp.tools.server_tools 7
-
libtmux_mcp.tools.session_tools 7
-
libtmux_mcp.tools.wait_for_tools 3
-
libtmux_mcp.tools.window_tools 9
-
libtmux._internal.constants 9
-
libtmux._internal.control_mode 1
-
libtmux._internal.dataclasses 1
-
libtmux._internal.env 5
-
libtmux._internal.query_list 21
-
libtmux._internal.sparse_array 4
-
libtmux._internal.types 1
-
tmuxp.cli.convert 4
-
tmuxp.cli.debug_info 5
-
tmuxp.cli.edit 3
-
tmuxp.cli.freeze 4
-
tmuxp.cli.ls 5
-
tmuxp.cli.search 19
- CLISearch
Namespace - Search
Pattern - Search
Token - Workspace
Fields - Workspace
Search Result - Invalid
Field Error - DEFAULT
_FIELDS - FIELD
_ALIASES - SEARCH
_DESCRIPTION - VALID
_FIELDS - command
_search - compile
_search _patterns - create
_search _subparser - evaluate
_match - extract
_workspace _fields - find
_search _matches - highlight
_matches - normalize
_fields - parse
_query _terms
- CLISearch
-
tmuxp.cli.shell 4
-
tmuxp.cli.utils 4
-
tmuxp.workspace.constants 1
-
tmuxp.workspace.importers 2
-
tmuxp.workspace.loader 4
-
tmuxp.workspace.options 4
-
libtmux_mcp.tools.pane_tools.capture_since 2
-
libtmux_mcp.tools.pane_tools.io 1
-
libtmux_mcp.tools.pane_tools.lifecycle 1
-
libtmux_mcp.tools.pane_tools.search 4
-
libtmux_mcp.tools.pane_tools.state 2
-
tmuxp.workspace.builder.classic 2