Read tmux variables (display_message)¶
display_message¶
Read tmux variables against a target and return the substituted text.
- Returns:
Use when you need to read a tmux variable no dedicated tool covers —
zoom state, pane dead flag, client activity. Despite the historical name
(display_message is the tmux verb it wraps), this tool does not display
anything to the user; it substitutes the variables and returns the value.
Avoid when a dedicated tool already provides the information — e.g. use
snapshot_pane for cursor position and mode,
get_pane_info for standard metadata (including the new
pane_left / pane_top / pane_at_* geometry block), or
find_pane_by_position to resolve a window corner to a
PaneInfo without parsing #{pane_at_bottom} / #{pane_at_right}
yourself.
Side effects: The built-in request reads data only. A configured alias or hook can add effects; see Trust model.
Accepts literal text and #{variable} references only. Modifiers such as
#{E:...} re-expand a variable’s value, which can arrive from a pane
rather than from you, so they are refused rather than filtered.
Modifiers, conditionals, and padding are therefore no longer available here.
Run tmux display-message -p through run_command for those: raw
format syntax belongs on the surface labelled execution, where the caller is
the one supplying it.
Example:
{
"tool": "display_message",
"arguments": {
"format_string": "zoomed=#{window_zoomed_flag} dead=#{pane_dead}",
"pane_id": "%0"
}
}
Response (string):
zoomed=0 dead=0
Parameters
Parameter |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
yes |
— |
Literal text and ‘#{variable}’ references (e.g. ‘#{cursor_x} #{cursor_y}’). |
|
|
no |
— |
Pane ID (e.g. ‘%1’). |
|
|
no |
— |
Session name for pane resolution. |
|
|
no |
— |
Session ID for pane resolution. |
|
|
no |
— |
Window ID for pane resolution. |
|
|
no |
— |
tmux socket name. |