# libtmux_mcp.tools.pane_tools.display_message

- **Module:** libtmux_mcp.tools.pane_tools
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/pane_tools/meta.py#L32
- **Page:** https://libtmux.org/en/py/stable/mcp/reference/libtmux_mcp-tools-pane_tools-display_message/

```
libtmux_mcp.tools.pane_tools.display_message(
    format_string: str,
    pane_id: str | None = None,
    session_name: str | None = None,
    session_id: str | None = None,
    window_id: str | None = None,
    socket_name: str | None = None,
) -> str
```

Read tmux variables against a target and return the substituted text.

Use this when no dedicated tool covers the field you want, e.g.
'#{[window_zoomed_flag](/en/tmux/latest/catalog/formats/window_zoomed_flag/)}', '#{[pane_dead](/en/tmux/latest/catalog/formats/pane_dead/)}', '#{[client_activity](/en/tmux/latest/catalog/formats/client_activity/)}'.

Accepts literal text and '#{variable}' references. Format modifiers,
conditionals, and jobs are refused: tmux expands '#{E:x}' by running
x's *value* through the expander again, and a value can arrive from a
pane rather than from the caller. For raw format syntax, run
'tmux [display-message](/en/tmux/latest/manual/display-message/) -p' through run_command, where the caller
supplies it on a surface labelled execution.

Returned values can carry text a pane chose, such as a working
directory or a running command.

## Parameters

- `format_string` (`str`): Literal text and '#{variable}' references (e.g.
'#{cursor_x} #{cursor_y}').
- `pane_id` (`str | None`): Pane ID (e.g. '%1').
- `session_name` (`str | None`): Session name for pane resolution.
- `session_id` (`str | None`): Session ID for pane resolution.
- `window_id` (`str | None`): Window ID for pane resolution.
- `socket_name` (`str | None`): tmux socket name.

## Returns

str
    Expanded format string result.

## Raises

- [`ExpectedToolError`](https://libtmux-mcp.git-pull.com/reference/api/utils/#libtmux_mcp._utils.ExpectedToolError): If ``format_string`` carries tmux format syntax other than
``#{variable}`` references.
