Window.display_message
Display message at window scope via $ tmux display-message.
Source and package
-
Description#
Like
Pane.display_messagebut 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 toWindow.cmd.Notes
Stderr from tmux is reported via
warnings.warn, not raised. Callers that want to escalate to an exception can wrap the call inwarnings.catch_warningswithfilterwarnings("error").Examples#
Read the window's id format:
>>> result = window.display_message("#{window_id}", get_text=True)>>> result[0].startswith("@")TrueCheck zoom state (a common gap-#670 use case):
>>> result = window.display_message(... "#{window_zoomed_flag}", get_text=True... )>>> result[0] in {"0", "1"}True- Parameters
-
-
cmd(str) # – Format string to display or evaluate (e.g."#{window_zoomed_flag}"). 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.
In other ports Show a message on the client viewing a window
- PowerShell No source-verified PowerShell equivalent is recorded for this operation.
- Julia No source-verified Julia equivalent is recorded for this operation.
- Ruby No source-verified Ruby equivalent is recorded for this operation.
- Lua No source-verified Lua equivalent is recorded for this operation.
- TypeScript no equivalent on
Window - Rust
- Go
- Java no equivalent on
Window - C#
- C++
- Swift no equivalent on
Window - Kotlin No source-verified Kotlin equivalent is recorded for this operation.
- Scala No source-verified Scala equivalent is recorded for this operation.
- F# No source-verified F# equivalent is recorded for this operation.