get_version
Return tmux version.
Source and package
- Qualified name
-
libtmux.common .get _version - Module
- libtmux.common
- Package
- libtmux
- Source
- src/libtmux/common.py
-
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
-openbsdappended to the latest version, e.g.2.4-openbsd.Notes
Memoized via
functools.cache, keyed on the tmux_bin argument (Noneis a distinct key from any explicit path), independently ofget_version_str. The cache is sticky acrossPATHchanges and on-disk binary swaps when tmux_bin isNoneor the same path string -- callget_version.cache_clear()to invalidate. Tests that monkey-patchtmux_cmdshould callcache_clear()before asserting parsed-version behavior.- Parameters
-
-
tmux_bin(str | None) # – Path to tmux binary. If None, uses the system tmux fromshutil.which.
-
- Returns
-
distutils.version.LooseVersiontmux version according to tmux_bin if provided, otherwise the system tmux fromshutil.which