brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Ctrl-b z zooms one pane to the whole window and brings the others back

Tmux
~/tips/tip-tmux-zoom-pane

Ctrl-b z

Makes the active tmux pane fill the whole window, and a second press restores the layout.

A pane the size of a quarter screen is no place to read a long log. Zoom it instead of closing the other panes.

Ctrl-b z

The other panes are only hidden and keep running. A Z appears next to the window name in the status bar while you are zoomed. Press the same keys again and the layout comes back.

I would call this the best tmux shortcut for people who are new to panes. A split window gives you an overview, and zoom gives you focus when you need to read something. You switch between the two without losing anything.

It also works well with copy mode. Zoom the pane, press Ctrl-b [, scroll through the output, leave with q and unzoom. If you forget that you are zoomed, the Z in the status bar is your reminder.

Some commands that change the layout, such as splitting, quietly leave zoom mode first, so a pane can seem to un-zoom by itself.

Try it without risk: start a throwaway session with tmux new -s scratch, use the shortcut or command above there, look at what changes, and close the session again with tmux kill-session -t scratch. Nothing else on your machine is touched.

Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official), On this site: Ctrl-b ! turns a cramped pane into a window of its own, On this site: Ctrl-b Alt-arrow resizes a tmux pane five cells at a time

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link