# libtmux.Window.display_message

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

```
libtmux.Window.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 window scope via ``$ tmux display-message``.

Like :meth:`Pane.display_message` but auto-injects ``-t @<window-id>``
instead of a pane id. Window-scoped format reads such as
``#{window_zoomed_flag}`` or ``#{window_active_clients}`` no longer
require dropping to :meth:`Window.cmd`.

## Example

Read the window's id format:

```python
>>> result = window.display_message("#{window_id}", get_text=True)
>>> result[0].startswith("@")
True
```

## Example

Check zoom state (a common gap-#670 use case):

```python
>>> result = window.display_message(
...     "#{window_zoomed_flag}", get_text=True
... )
>>> result[0] in {"0", "1"}
True
```
