Skip to content

Instantly share code, notes, and snippets.

@bartj3
Created March 25, 2015 11:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bartj3/6d3bd8efd2ceaf02d443 to your computer and use it in GitHub Desktop.
Save bartj3/6d3bd8efd2ceaf02d443 to your computer and use it in GitHub Desktop.
Hide tmux status bar when zoomed in on a pane
bind-key z resize-pane -Z \; if-shell "tmux list-panes -F '#F' | grep -q Z" "set -g status off" "set -g status on"
@chrisshroba
Copy link

chrisshroba commented Apr 21, 2018

Thanks for this! I modified it slightly:

set-hook -g after-resize-pane "if-shell \"tmux list-panes -F '#F' | grep -q Z\" \"set -g status off\" \"set -g status on\""

This makes it so that it'll check whether to show or hide on status bar after every resize instead of only after ones that are triggered by the Prefix + z combination. So running tmux resize-pane -Z will trigger the check.

I wanted this because I have a vim command that goes into a distraction-free mode (using Goyo) and automatically zooms the pane, and this way it'll also automatically hide the status bar.

Anyways, just wanted to comment in case this helps someone else, and to thank you for this super useful snippet!

@duclos-cavalcanti
Copy link

Thanks you both for this snippet, makes a huge difference!

@codedeeply
Copy link

The modified version still works; thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment