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_str

Return the tmux version string verbatim, preserving letter suffixes.

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

Description#

get_version normalizes point releases for numeric comparison ("3.7a" becomes LooseVersion("3.7")). This helper keeps the raw suffix, so callers can distinguish patch releases whose behavior differs -- for example the tmux 3.7 break-pane crash, reverted in 3.7a.

Notes

Memoized via functools.cache , keyed on tmux_bin, independently of get_version . Call get_version_str.cache_clear() after swapping the tmux binary.

Examples#

>>> isinstance(get_version_str(), str)
True
Parameters
  • tmux_bin (str | None) # – Path to tmux binary. If None, uses the system tmux.

Returns

str Raw tmux version, e.g. "3.7a". Git builds return "master"; OpenBSD base tmux returns "<max>-openbsd".

Esc

Type to search.

Reference preview Open reference