9

I use tmux 1.8 so I have built in CTRL+b+z feature to zoom an active pane.
The problem is that zoomed pane looks the same as just one plain pane so sometimes I forget if the pane was zoomed. Is there a way to add an indication that I am currently in the zoom mode?

Also the same issue is with horizontally split panes. It's hard to remember that if the border on the left corresponds to the active upper pane and vice versa. Can I make that more distinct? Maybe add horizontal borders if that's possible?

0

2 Answers 2

15

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.
1
  • 1
    The list of window flags with their explanation can also be found in man tmux /STATUS LINE, you’re missing M for the marked window here.
    – dessert
    Dec 19, 2019 at 14:18
4

Tmux adds a Z to the end of the window name in the status bar to indicate that the pane is zoomed. Or at least the 1.9 version I'm using does this by default.

2
  • I use tmux 1.9 with VIM and tmuxline plugin and I do not have such thing. Maybe it need to change tmuxline preset?
    – Glueon
    Feb 8, 2015 at 16:36
  • I would guess so. First try disabling tmuxline and see if you see it. Feb 8, 2015 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.