At the same time as the zoom feature, the window_flag
with the same name Z
was added, so this flag should appear in the status line next to the window title (you mention in a comment that you use some plugin/customization of tmux).
In any case, you can query tmux using the list-panes
command and the formats
feature:
tmux list-panes -F '#F'
prints out all the window flags of the currently active pane. If Z
is among the flags, the current pane is zoomed. Thus, the command
tmux list-panes -F '#F' | grep -q Z
will return 0
if the current pane is zoomed and return error 1
in case it isn't. This should allow you to add this indicator to your customized status line.
From man tmux
:
FORMATS
Certain commands accept the -F flag with a format argument. This is a
string which controls the output format of the command. Replacement
variables are enclosed in ‘#{’ and ‘}’, for example ‘#{session_name}’.
The possible variables are listed in the table below, or the name of a
tmux option may be used for an option's value. Some variables have a
shorter alias such as ‘#S’, and ‘##’ is replaced by a single ‘#’.
[...]
Variable name Alias Replaced with
[...]
window_flags #F Window flags
Looking at the source code (window.c, line 639f) shows that the complete list of flags is:
#: window activity flag
!: window bell flag
~: window silence flag
*: current window flag
-: last window flag
Z: window zoomed flag
' ' (a space): no flags at all.