On this page
libtmux.Server.display_message
- Module
- libtmux
- Declared in
- Server
- Package
- libtmux
- Source
- src/libtmux/server.py
-
Display message at server scope via
$ tmux display-message.Like
Pane.display_messagebut without-t <pane-id>injection. tmux'scmd-display-messageentry usesCMD_FIND_CANFAILso the target is optional; server-scoped format reads (#{version},#{socket_path},#{pid}) resolve without a specific pane handle.With no client attached and
target_clientomitted, the status-line path (get_text=False) issues ano current clientwarning. Useget_text=Truefor headless reads, or pair withControlMode.Examples
Read tmux version without needing a pane handle:
>>> result = server.display_message("#{version}", get_text=True) >>> isinstance(result, list) and len(result) == 1 TrueDump every format variable:
>>> result = server.display_message("", get_text=True, all_formats=True) >>> any("session_name=" in line for line in result) True- Parameters
-
-
cmd ( str ) – Format string to display or evaluate (e.g.
"#{version}"). Pass""together withall_formats=Trueto dump every variable. added 0.57 -
get_text ( bool ) – Return tmux's stdout instead of rendering to the status line (
-pflag). added 0.57 -
format_string ( str | None ) – Alternative format template (
-Fflag). added 0.57 -
all_formats ( bool | None ) – List all format variables (
-aflag). added 0.57 -
verbose ( bool | None ) – Show format variable types (
-vflag). added 0.57 -
no_expand ( bool | None ) – Output the literal string without format expansion (
-lflag). Requires tmux 3.4+. added 0.57 -
target_client ( str | None ) – Target client (
-cflag). added 0.57 -
delay ( int | None ) – Display time in milliseconds (
-dflag). added 0.57 -
notify ( bool | None ) – Do not wait for input (
-Nflag). added 0.57
-
- Returns
-
list[str] | None Message output if
get_textis True, otherwiseNone.
0 declared, 0 inherited