Skip to content

feat(tmux): add popup session support#50

Merged
zkhvan merged 3 commits into
mainfrom
zk-popup
Mar 26, 2026
Merged

feat(tmux): add popup session support#50
zkhvan merged 3 commits into
mainfrom
zk-popup

Conversation

@zkhvan
Copy link
Copy Markdown
Owner

@zkhvan zkhvan commented Mar 26, 2026

Summary

Add tmux popup session management — lightweight, ephemeral overlay sessions that float above the current tmux session.

  • z tmux popup use <name> — creates and opens a named popup session attached to the current parent session, displayed via tmux display-popup. Configurable width/height. Popup sessions have status bar and prefix disabled, with S-F1 to detach and M-[ for copy-mode (conditionally bound so they pass through to applications when not in a popup).
  • z tmux popup list — lists popup sessions belonging to the current parent session.
  • z tmux popup kill [name] [--all] [--zombies] — kills a specific popup, all popups for the current session, or orphaned popups whose parent session no longer exists.
  • Session integrationz tmux session list and z tmux session use now hide popup sessions from selection. z tmux session kill automatically cleans up associated popup sessions when killing a parent.
  • Popup naming convention — popup sessions use the format _popup_<parent>__<name>, with helpers in pkg/tmux/popup.go for parsing and matching.
  • tmux library additionsCurrentSessionName, HasSession, NewSessionDetached, SetSessionOption, BindKey, DisplayPopup, and improved KillSession to accept name or ID.

Test plan

  • Run z tmux popup use scratch — verify popup opens, S-F1 detaches it
  • Verify S-F1 works normally (passes through) when not in a popup session
  • Run z tmux popup list — verify it shows scratch
  • Run z tmux popup kill scratch — verify it's removed
  • Run z tmux session kill — verify associated popups are cleaned up
  • Run z tmux popup kill --zombies after manually killing a parent session
  • Verify z tmux session list and z tmux session use don't show popup sessions

zkhvan added 3 commits March 21, 2026 21:18
Add dismissable tmux popup windows per project. Popup sessions persist
in the background when dismissed and reappear on toggle.
Popup sessions nest a tmux client inside display-popup, which means
OSC 52 clipboard escape sequences get sent to the popup's pseudo-terminal
rather than the real terminal, breaking clipboard integration.

Additionally, the custom "popup" key-table replaced the root key-table
entirely, which broke all mouse bindings (scroll, drag-to-select, click)
since they live in the root table.

Changes:
- Drop the custom popup key-table in favor of conditional root bindings
  using tmux's #{m:} pattern matching against the _popup_ session prefix
- Rely on `prefix None` to disable prefix-based bindings
- Move clipboard handling to tmux.conf via `copy-command` server option,
  which pipes all copy operations through pbcopy globally

See:
- tmux/tmux#2921
- tmux/tmux#3817 (comment)
@zkhvan zkhvan merged commit b2c3f89 into main Mar 26, 2026
1 check passed
@zkhvan zkhvan deleted the zk-popup branch March 26, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant