Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux latest

Window.display_message

Display message at window scope via $ tmux display-message.

Source and package
Qualified name
libtmux.Window.display_message
Module
libtmux
Declared in
Window
Package
libtmux
Source
src/libtmux/window.py
Other languages
Perl Erlang PowerShell Julia Elixir Haskell Common Lisp Ruby Lua TypeScript RustGo Java C#C++ Swift Kotlin Scala OCaml F# Clojure
display_message
( 10 parameters ) ( 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]
( 10 parameters ) ( self, cmd: str, get_text: t.Literal[False] = ..., 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 = ..., )
→ None
( 10 parameters ) ( self, cmd: str, get_text: bool = False, format_string: str | None = None, all_formats: bool | None = None, verbose: bool | None = None, no_expand: bool | None = None, target_client: str | None = None, delay: int | None = None, notify: bool | None = None, )
→ list[str] | None

Description#

Like 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 Window.cmd().

Notes

Stderr from tmux is reported via warnings.warn, not raised. Callers that want to escalate to an exception can wrap the call in warnings.catch_warnings with filterwarnings("error").

Examples#

Read the window's id format:

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

Check 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
Returns

list[str] | None Message output if get_text is True, otherwise None.

tmux command#

The tmux commands behind display_message.

tmux C API#

The C declarations in tmux that implement these commands.

In other ports#

Show a message on the client viewing a window

Equivalents of Show a message on the client viewing a window in other languages
Language Equivalent
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript no equivalent on Window
Rust window.Window.display
Go tmux.Window.DisplayMessage
Java no equivalent on Window
C# LibTmux.Window.DisplayMessageAsync
C++ libtmux::Window::show_message
Swift no equivalent on Window
OCaml No direct public OCaml equivalent is recorded for this operation.
Perl No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands.

No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference