Copy, paste & context menus
How clipboard copy and paste work across HTTPS, plain HTTP LAN/Tailscale origins, OSC 52, terminal & tab right-click menus, and chat copy buttons.
Copying from or pasting into a browser-based terminal breaks in subtle ways over plain HTTP (for example a LAN IP or an unencrypted Tailscale address). muxbay wraps clipboard I/O, terminal selection, and right-click menus so copy/paste stays reliable on desktop and mobile without stealing terminal focus.
Keyboard shortcuts
| Action | macOS | Linux / Windows | Notes |
|---|---|---|---|
| Copy terminal selection | ⌘C | Ctrl+Shift+C | Copies active selection; sends SIGINT only when nothing is selected |
| Paste into terminal | ⌘V | Ctrl+Shift+V | Reads clipboard on HTTPS; opens the Paste dialog on HTTP if blocked |
| Clear terminal buffer | ⌘K | Ctrl+K | Wipes visible viewport only; keeps shell running |
| Submit inside Paste dialog | ⌘Enter | Ctrl+Enter | Inserts text without pressing Enter in the shell |
HTTPS vs. plain HTTP (LAN / Tailscale)
Browsers restrict navigator.clipboard.readText() and async writeText() to secure contexts (https:// or http://localhost).
- Copy (
src/lib/clipboard.ts): On secure origins, muxbay usesnavigator.clipboard.writeText(). On plain HTTP origins (such ashttp://192.168.x.x:8022), it falls back synchronously to a hidden<textarea>+document.execCommand('copy')before anyawaitso transient user activation is preserved, and restores focus to the terminal immediately afterward. - Paste: When
navigator.clipboard.readText()is unavailable or denied, clicking Paste (or pressing Ctrl+Shift+V) opens the Paste Dialog automatically.
The Paste dialog (Paste vs. Paste & Send)
Whenever direct clipboard reading isn't permitted — or when you click the Paste toolbar button on desktop or mobile — muxbay opens the Paste dialog (TerminalPasteDialog):
- Paste (⌘Enter / Ctrl+Enter) — sends the text cleanly to the shell via bracketed paste (
pasteTerminalText) without submitting Enter. Safe for multi-line commands or reviewing before execution. - Paste & Send — inserts the text and appends a newline/carriage return so the command or prompt runs immediately.
On touch devices, a compact Paste button is shown in the terminal toolbar so mobile users can paste multi-line snippets reliably.
OSC 52 fallback
Remote tools inside tmux (such as vim, neovim, or less configured with OSC 52) emit terminal escape sequences when you yank text. muxbay captures the latest OSC 52 payload per terminal pane:
- A toast notification lets you copy it with one click if the browser blocked background clipboard writes.
- In the terminal right-click menu, if no xterm.js selection is currently highlighted, Copy becomes Copy last selection and copies the most recent OSC 52 payload.
Terminal right-click context menu
Right-clicking inside any terminal opens the custom terminal context menu (without triggering tmux mouse mode or clearing your xterm.js selection):
| Item | Shortcut | What it does |
|---|---|---|
| Copy / Copy last selection | ⌘C / Ctrl+Shift+C | Copies selected terminal text, or falls back to the latest OSC 52 buffer |
| Paste | ⌘V / Ctrl+Shift+V | Pastes from clipboard or opens the Paste dialog |
| Select All | — | Selects the entire xterm.js scrollback buffer |
| Copy output… | — | Opens the full scrollable terminal capture drawer so you can inspect or copy large outputs cleanly |
| Clear | ⌘K / Ctrl+K | Clears the visible viewport |
Tab right-click context menu
Right-clicking any tab in a pane's tab bar opens actions specific to that tab:
- Rename — inline rename of the tab label.
- Copy terminal output… — opens the scrollable output capture drawer (for terminal/agent tabs).
- Copy worktree path — copies the full path of an isolated Git worktree tab under
~/.purplemux/worktrees/. - Move to workspace — submenu listing all other workspaces; moves the live tab and renames its tmux session in place without killing the running process.
- Close / Close other tabs — closes the tab (with dirty-state confirmation for worktree tabs) or closes sibling tabs in the same pane.
Chat / Timeline copy buttons
In Chat / Timeline mode, every rendered code block and assistant message includes an accessible one-click Copy button that uses the same HTTPS/HTTP clipboard helper so copying snippets over LAN or Tailscale never loses your place.
What's next
- Tabs, panes & drag-drop — reordering tabs and dragging live tabs between workspaces.
- Git worktrees & launch dialog — copying worktree paths and launching with an initial prompt.
- Tailscale access — enable automatic HTTPS for seamless native clipboard access.