# libtmux.Server.display_message

- **Module:** libtmux.Server
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/server.py#L1588
- **Page:** https://libtmux.org/reference/py/libtmux-server-display_message/

```
libtmux.Server.display_message(self, cmd: str, get_text: t.Literal[True], format_string: str | None = ..., all_formats: bool | None = ..., verbose: bool | None = ..., no_expand: bool | None = ..., target_client: str | None = ..., delay: int | None = ..., notify: bool | None = ...) -> list[str]
```

Display message at server scope via ``$ tmux display-message``.

Like :meth:`Pane.display_message` but without ``-t <pane-id>`` injection.
tmux's ``cmd-display-message`` entry uses ``CMD_FIND_CANFAIL`` so the
target is optional; server-scoped format reads (``#{version}``,
``#{socket_path}``, ``#{pid}``) resolve without a specific pane handle.

With no client attached and ``target_client`` omitted, the status-line
path (``get_text=False``) issues a ``no current client`` warning. Use
``get_text=True`` for headless reads, or pair with
:class:`~libtmux._internal.control_mode.ControlMode`.

## Example

Read tmux version without needing a pane handle:

```python
>>> result = server.display_message("#{version}", get_text=True)
>>> isinstance(result, list) and len(result) == 1
True
```

## Example

Dump every format variable:

```python
>>> result = server.display_message("", get_text=True, all_formats=True)
>>> any("session_name=" in line for line in result)
True
```
