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.

function libtmux stable

get_version

Return tmux version.

Source and package
Qualified name
libtmux.common.get_version
Module
libtmux.common
Package
libtmux
Source
src/libtmux/common.py
get_version (tmux_bin: str | None = None) → LooseVersion

Description#

If tmux is built from git master, the version returned will be the latest version appended with -master, e.g. 2.4-master.

If using OpenBSD's base system tmux, the version will have -openbsd appended to the latest version, e.g. 2.4-openbsd.

Notes

Memoized via functools.cache , keyed on the tmux_bin argument (None is a distinct key from any explicit path), independently of get_version_str . The cache is sticky across PATH changes and on-disk binary swaps when tmux_bin is None or the same path string -- call get_version.cache_clear() to invalidate. Tests that monkey-patch tmux_cmd should call cache_clear() before asserting parsed-version behavior.

Parameters
Returns

distutils.version.LooseVersion tmux version according to tmux_bin if provided, otherwise the system tmux from shutil.which

Esc

Type to search.

Reference preview Open reference