Quantcast
Channel: User Kamil Maciorowski - Super User
Viewing all articles
Browse latest Browse all 837

Answer by Kamil Maciorowski for Change Tmux background colour of zoomed pane

$
0
0

Take this one-liner (split into multiple lines for readability) as an example:

tmux set-hook -g after-resize-pane \'if "[ #{window_zoomed_flag} -eq 1 ]" \"run \"tmux select-pane -P bg=red\"" \"run \"tmux select-pane -P bg=black\""'

Run it in a shell within tmux and zoom any pane to test the solution.

Notes:

  • It's pure tmux solution, it doesn't depend on iTerm2.

  • There are three levels of quoting (single-quotes, double-quotes, escaped double-quotes). While adjusting the command to your needs don't mix them up.

  • -g means the hook is global; without -g it's a session hook.

  • Unset the hook with tmux set-hook -gu after-resize-pane.

  • To make the solution permanent, add this line to ~/.tmux.conf (or /etc/tmux.conf):

    set-hook -g after-resize-pane 'if "[ #{window_zoomed_flag} -eq 1 ]" "run \"tmux select-pane -P bg=red\"" "run \"tmux select-pane -P bg=black\""'

Viewing all articles
Browse latest Browse all 837

Trending Articles