Skip to content

Instantly share code, notes, and snippets.

@gwpl
Created February 16, 2026 22:26
Show Gist options
  • Select an option

  • Save gwpl/0ba627b3983271c32c257ba5da9b65ed to your computer and use it in GitHub Desktop.

Select an option

Save gwpl/0ba627b3983271c32c257ba5da9b65ed to your computer and use it in GitHub Desktop.
title
Tmux Popup Notes

Ahhh, this is a good one — this is exactly the kind of terminal ergonomics question that separates casual tmux users from people who live in their terminal.

You’re basically asking:

“How do I open a small ‘box’ over my current running pane and run a command inside it?”

In tmux terminology, you’re looking for popups.


🧊 tmux Popup (The “box over running section”)

Since tmux 3.2, you can open a floating popup window over your current pane.

Open a popup with a shell

Inside tmux:

Ctrl-b :

Then type:

display-popup

This opens a floating shell.


Open a popup running a specific command

Example:

Ctrl-b :
display-popup -E htop

-E → closes popup when command exits.

Or:

display-popup -E bash

🎯 Bind it to a key (recommended)

You don’t want to type that every time.

Add to ~/.tmux.conf:

bind-key p display-popup -E

Reload:

Ctrl-b :
source-file ~/.tmux.conf

Now:

Ctrl-b p

→ Opens a popup shell.


🧠 Advanced Usage (You’ll Like This)

Custom size

display-popup -w 80% -h 60% -E lazygit

Width 80%, height 60%.


Centered fixed size box

display-popup -w 100 -h 30 -E bash

Use it for git quickly

bind-key g display-popup -w 80% -h 80% -E lazygit

⚡ What This Is Perfect For

Given you:

  • use Arch
  • live in tmux
  • like tight CLI workflows

Popups are ideal for:

  • lazygit
  • htop
  • nmtui
  • quick python REPL
  • temporary debugging
  • quick note writing
  • GitHub CLI inspection
  • interactive fzf search

It’s like having a modal tool without destroying your layout.


🪟 Alternative: Split Instead of Popup

If you meant something like a smaller box inside the layout:

Horizontal split:

Ctrl-b "

Vertical split:

Ctrl-b %

But that changes layout permanently.

Popup does not.


🔥 Even More Advanced (Overlay-like behavior)

You can combine:

display-popup -E "bash -c 'your-command; read'"

So it stays open after command finishes.


If you want, I can also show you:

  • How to make popups semi-transparent (KDE + Konsole specific)
  • How to replicate Vim-style floating terminal behavior
  • How to emulate GNU screen behavior (since you’ve compared them before)
  • How to build a full “overlay toolkit” inside tmux

What exactly is your intended workflow for the box? Debugging? Monitoring? Quick commands?


Yes — and this is where tmux becomes very composable.

Short answer:

  1. ✅ You can trigger a popup from inside bash running in a tmux pane.
  2. ⚠️ You cannot dynamically resize an already-open popup (it must be recreated).

Let’s go precise.


1️⃣ Running a popup from inside bash (in a tmux pane)

From inside a tmux pane, just run:

tmux display-popup -E

That opens a popup shell over your current pane.

You can run any command:

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

or

tmux display-popup -E "bash -c 'echo hello; read'"

This works because inside a tmux pane:

  • $TMUX is set
  • tmux client attaches to current session automatically

You don’t need to specify -t.


🧠 Very Useful Pattern

Make a bash alias:

alias tpop='tmux display-popup -w 80% -h 60% -E'

Then:

tpop lazygit
tpop htop
tpop python

Now you’ve got modal tools anywhere.


2️⃣ Can you resize a popup after opening?

❌ No — not interactively.

Popups are not panes.

They are temporary overlays rendered by tmux’s display layer.

There is:

  • no resize-pane equivalent
  • no mouse resize
  • no key resize

To change size → you must close and reopen.


3️⃣ Workaround: Reopen with new size

Example:

tmux display-popup -w 90% -h 80% -E bash

Or absolute size:

tmux display-popup -w 120 -h 40 -E bash

4️⃣ Advanced: Dynamic Size Based on Current Pane

If you want something adaptive:

tmux display-popup -w "#{pane_width}" -h "#{pane_height}" -E bash

Or smaller than current pane:

tmux display-popup -w "#{?pane_width,#{pane_width},80}" -h 70% -E bash

tmux format strings work here.


5️⃣ Important Architectural Insight

Why you can’t resize:

  • Popup is not part of layout tree
  • It doesn’t participate in pane sizing
  • It’s rendered independently

If you need:

  • resizing
  • splitting inside it
  • long-running structured workflow

→ Use a normal pane instead.

Popups are ideal for:

  • short-lived tools
  • quick inspection
  • modal utilities

6️⃣ Hybrid Trick (You’ll Like This)

You can run a new tmux session inside a popup:

tmux display-popup -w 80% -h 80% -E "tmux new-session -A -s scratch"

Now inside popup you have:

  • full tmux
  • splits
  • resizing
  • persistent layout

Close popup → session keeps running.

That gives you a floating workspace.

Very powerful.


7️⃣ Quick Decision Table

Need Use
Temporary command Popup
Resize later Pane
Structured mini workspace tmux-in-popup
Replace screen-style workflow Pane splits

Given you’re on Arch + KDE Konsole + heavy tmux user:

If you tell me what your intended workflow is (debugging? Git? REPL? monitoring?), I can suggest the cleanest ergonomic pattern.

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