openmux
v0.2.120
Published
Terminal multiplexer with master-stack tiling layout
Maintainers
Readme
openmux
A terminal multiplexer with master-stack layout (Zellij-style), built with:
- Bun - Fast JavaScript runtime
- OpenTUI - Terminal UI library with SolidJS reconciler
- SolidJS - Reactive UI framework
- zig-pty - PTY support for Bun (pure Zig implementation)
- libghostty-vt - Native terminal emulation (VT parser/state)

Features
- Master-stack tiling layout (like Zellij)
- i3-gaps style gaps and borders
- Vim-style
hjklnavigation - Tmux-style
Ctrl+bprefix key - 9 workspaces with isolated pane layouts
- Session persistence and management
- Detach/attach (leave sessions running in background)
- Pane zoom (fullscreen focused pane)
- Aggregate view for browsing/filtering PTYs across workspaces
- Mouse tracking (click to focus, tabbed pane switching)
- Scrollback support with mouse wheel and scrollbar
- Kitty graphics protocol support (image rendering, pixel sizing, SSH-aware offloading)
Installation
Quick Install (curl)
curl -fsSL https://raw.githubusercontent.com/monotykamary/openmux/main/scripts/install.sh | bashnpm / bun
npm install -g openmux
# or
bun add -g openmuxFrom Source
git clone https://github.com/monotykamary/openmux.git
cd openmux
bun install
bun run build --installGitHub Releases
Download prebuilt binaries from GitHub Releases.
Available platforms:
- macOS (Apple Silicon)
- Linux (x64 / arm64)
Usage
openmuxFor development:
bun start # Run from source
bun dev # Run with watch modeCLI
openmux ships a headless-style CLI that talks to the running UI for pane/layout operations and uses on-disk session metadata for session listing/creation.
openmux --help
openmux pane --help
openmux pane capture --helpExamples:
openmux session list --json
openmux session create dev
openmux attach --session dev
openmux pane split --direction vertical --workspace 2
openmux pane send --pane focused --text "npm test\n"
openmux pane capture --pane focused --lines 200 --format ansiNotes:
- Pane commands require a running UI (control socket available).
pane sendsupports C-style escapes like\n,\t,\xNN,\uXXXX.- See
docs/guides/cli.mdfor the full spec and exit codes.
Architecture (High Level)
┌─────────────────────────┐
│ Host Terminal (TTY) │
└────────────┬────────────┘
│ input/output
v
┌─────────────────────────┐
│ openmux UI (client) │ Solid + OpenTUI
└────────────┬────────────┘
│ shim protocol (detach/attach)
v
┌─────────────────────────┐
│ shim server (background)│
└────────────┬────────────┘
│ PTY I/O + emulation
v
┌─────────────────────────┐
│ zig-pty + libghostty-vt │
└─────────────────────────┘Keyboard Shortcuts
Normal Mode (Alt shortcuts - no prefix needed)
Alt+h/j/k/l- Navigate panesAlt+m- Enter move modeAlt+n- New paneAlt+s- Open session pickerAlt+t- Open template overlayAlt+g- Open aggregate view (browse all PTYs)Alt+f- Open searchAlt+p- Open command paletteAlt+[/Alt+]- Cycle layout mode (vertical → horizontal → stacked)Alt+z- Toggle zoom (fullscreen focused pane)Alt+x- Close paneAlt+-- Split pane horizontallyAlt+\- Split pane verticallyAlt+1-9- Switch to workspace 1-9
Mouse
Click- Focus paneClick tab- Switch to stacked pane (in stacked mode)Scroll wheel- Scroll through terminal history (when not in alternate screen apps like vim)Click scrollbar- Jump to position in scrollbackDrag scrollbar- Scroll through history by dragging
Prefix Mode (Ctrl+b, 2s timeout)
1-9- Switch to workspace 1-9norEnter- New paneh/j/k/l- Navigate panesm- Enter move mode\- Split pane vertically-- Split pane horizontallyv- Set layout mode: verticalH- Set layout mode: horizontalt- Set layout mode: stacked (tabbed)T- Open template overlayx- Close panez- Toggle zooms- Open session pickerg- Open aggregate view (browse all PTYs)/- Open search:- Open command palette]orp- Paste from clipboard`- Toggle console overlayq- Quit openmuxd- Detach (leave session running in background)Esc- Exit prefix mode
Move Mode
h/j/k/l- Move focused pane west/south/north/eastEsc- Exit move mode
Search Mode
Ctrl+n- Next matchCtrl+p- Previous matchEnter- Confirm selection and jumpEsc- Cancel searchBackspace- Delete last character
Command Palette
↑/↓- Navigate commandsEnter- Execute selected commandEsc- Close command paletteBackspace- Delete last character
Template Overlay
Apply Tab:
↑/↓- Navigate templatesEnter- Apply selected templateTab- Switch to save tabCtrl+x/Ctrl+d- Delete templateEsc- Close overlay
Save Tab:
Enter- Save current layout as templateTab- Switch to apply tabBackspace- Delete last characterEsc- Close overlay
Aggregate View
List:
↑/↓- Navigate PTYsEnter- Preview selected PTYTab- Jump to selected PTY and close viewAlt+a- Toggle scope (all workspaces vs current)Alt+x- Kill selected PTYBackspace- Delete last filter characterAlt+Esc- Close aggregate view
Preview:
Alt+Esc- Return to listAlt+f- Open search in previewAlt+x- Kill current PTY- Full keyboard/mouse support for terminal interaction
Search (in preview):
Ctrl+n- Next matchCtrl+p- Previous matchEnter- Jump to matchEsc- Exit searchBackspace- Delete last character
Prefix (in preview):
q- Quit openmuxd- DetachEsc- Return to list/- Open search
Session Picker
List Tab:
↑/↓- Navigate sessionsEnter- Select or create sessionCtrl+n- Create new sessionCtrl+r- Rename sessionCtrl+x/Ctrl+d- Delete sessionBackspace- Delete last filter characterEsc- Close picker
Rename Tab:
Enter- Confirm new nameEsc- Cancel renameBackspace- Delete last character
Confirmation Dialog
h/←orl/→- Focus confirm/cancelTab- Toggle between confirm/cancelEnter- ConfirmEsc- Cancel
Vim Mode (Overlays, opt-in)
Enable via the command palette ("Toggle overlay vim mode"), or in config.toml:
[keyboard]
vimMode = "overlays"
vimSequenceTimeoutMs = 1000When enabled, overlays open in normal mode:
j/k- Navigate listsgg/G- Jump to first/last itemEnter- Confirm/previewq- Close overlayi- Enter insert modeEsc- Return to normal mode- Search overlays:
n/Nfor next/prev match
Concepts
Why openmux (vs tmux / zellij)
- Single-client steal/lock: predictable attach semantics; new client wins and old client detaches.
- UI binary swap: update the UI without touching running PTYs (shim stays alive).
- UI-first architecture: SolidJS/OpenTUI enables richer overlays and layout evolution.
- PTY state snapshots: fast attach with immediate state restore (no full redraw pipeline).
- Emulator ownership: aggregate previews, scrollback caching, and search are first-class.
- Lower client CPU: shim does emulation; client focuses on rendering updates.
Workspaces
Like i3/sway, openmux supports multiple workspaces (1-9). Each workspace has its own layout tree of panes. The status bar shows populated workspaces dynamically - empty workspaces don't appear unless active.
Layout Modes (Zellij-style)
Each workspace has a layout mode that determines how panes are arranged:
- Vertical (
│): Main pane on left, stack panes split vertically on right - Horizontal (
─): Main pane on top, stack panes split horizontally on bottom - Stacked (
▣): Main pane on left, stack panes tabbed on right (only active visible)
Sessions
Sessions persist your workspace layouts and pane working directories. Sessions are auto-saved to ~/.config/openmux/sessions/ and can be switched via the session picker (Alt+s or Ctrl+b then s).
Configuration
openmux loads ~/.config/openmux/config.toml (or $XDG_CONFIG_HOME/openmux/config.toml). If the file is missing, a full default config is generated on startup. Deleting the file and restarting openmux will regenerate it.
Config changes are hot-reloaded while openmux is running (layout, theme, and keybindings update live).
See docs/guides/config.md for the full generated config.
Environment variables override the config file for layout values:
OPENMUX_WINDOW_GAPOPENMUX_MIN_PANE_WIDTHOPENMUX_MIN_PANE_HEIGHTOPENMUX_STACK_RATIO(maps tolayout.defaultSplitRatio)
To unbind a keybinding, set its value to null or "unbind".
Detach / Attach
Use Ctrl+b d to detach and leave the background shim running. Reattach by launching openmux again. Detach/attach uses a single-client lock; a new client steals the lock and the previous client detaches.
Aggregate View
A fullscreen overlay (Alt+g or Ctrl+b then g) that lets you browse all PTYs across all workspaces in one place. Features:
- Card-style PTY list showing directory, process name, and git branch
- Interactive terminal preview with full input support (keyboard + mouse)
- Filter by typing to search by process name, directory, or git branch
- Navigate with arrow keys (or
j/kin overlay vim mode),Enterto interact,Prefix+Escto return to list
Development Status
Current status:
- [x] Master-stack layout with gaps
- [x] OpenTUI component layer
- [x] Keyboard navigation system
- [x] PTY integration
- [x] libghostty-vt native terminal emulation
- [x] Workspaces (1-9)
- [x] Layout modes (vertical/horizontal/stacked)
- [x] Session persistence
- [x] Pane zoom
- [x] Mouse support
- [x] Scrollback support
- [x] Aggregate view (PTY browser)
- [x] Attach/detach (steal + lock)
- [x] Configurable keybindings
- [x] Configurable settings and colors
- [x] Kitty graphics protocol support
License
MIT
