# libtmux.common._query_version

- **Module:** libtmux.common
- **Package:** libtmux
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/common.py#L400
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-common-_query_version/

```
libtmux.common._query_version(
    tmux_bin: str | None = None,
) -> str
```

Return the raw ``tmux -V`` version token, letter suffix intact.

Runs ``tmux -V`` and extracts the version token (e.g. ``"3.7a"``,
``"master"``, ``"next-3.8"``). Not memoized -- :func:`get_version` and
:func:`get_version_str` each cache their own result on top of this query.

## Parameters

- `tmux_bin` (`str | None`): Path to tmux binary. If *None*, uses the system tmux.

## Returns

str
    Raw version token from ``tmux -V``.

## Raises

- [`_TmuxVersionUnavailable`](/en/py/stable/reference/libtmux-common-_tmuxversionunavailable/): tmux predates the ``-V`` flag; callers apply
:func:`_no_version_flag_fallback`.
- [`VersionTooLow`](/en/py/stable/reference/libtmux-exc-versiontoolow/): tmux reported another error on ``-V``.
