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: tmux display-popup opens a floating window over your panes

Tmux
~/tips/tip-tmux-display-popup

tmux display-popup -E -w 80% -h 80% htop

Opens a temporary floating window in tmux for a quick command, without touching your layout.

Sometimes I want to run one quick thing, a git status or a look at htop, and I don’t want to split a pane and wreck a layout I spent time on. Since tmux 3.2 there’s display-popup (short: popup), a floating window on top of everything.

tmux display-popup -E -w 80% -h 80% htop

According to the man page, -E closes the popup automatically when the command exits, and -w and -h take a size, a percentage included. Leave them out and the popup is half the terminal. Without a command you get a shell in it.

A key binding for ~/.tmux.conf:

bind T display-popup -E -w 80% -h 80% -d "#{pane_current_path}"

Press prefix and T, look at what you need, quit, and you’re back in your panes as if nothing happened. -d appears in the synopsis as the start directory, so this example opens the popup where you were working.

Caveats: your tmux needs to be 3.2 or newer, so check tmux -V on older LTS servers. The extra styling flags like -b and -T came in 3.3. And run tmux list-keys before you bind a key, so you don’t overwrite a default you use.

Further reading: tmux(1) man page, tmux CHANGES

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