Terminal multiplexer with master-stack tiling layout
npm install 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)
- Master-stack tiling layout (like Zellij)
- i3-gaps style gaps and borders
- Vim-style hjkl navigation
- Tmux-style Ctrl+b prefix 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)
``bash`
curl -fsSL https://raw.githubusercontent.com/monotykamary/openmux/main/scripts/install.sh | bash
`bash`
npm install -g openmuxor
bun add -g openmux
`bash`
git clone https://github.com/monotykamary/openmux.git
cd openmux
bun install
bun run build --install
Download prebuilt binaries from GitHub Releases.
Available platforms:
- macOS (Apple Silicon)
- Linux (x64 / arm64)
`bash`
openmux
For development:
`bash`
bun start # Run from source
bun dev # Run with watch mode
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.
`bash`
openmux --help
openmux pane --help
openmux pane capture --help
Examples:
`bash`
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 ansi
Notes:
- Pane commands require a running UI (control socket available).
- pane send supports C-style escapes like \n, \t, \xNN, \uXXXX.docs/guides/cli.md
- See for the full spec and exit codes.
``
┌─────────────────────────┐
│ 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 │
└─────────────────────────┘
- 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
- 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
- 1-9 - Switch to workspace 1-9n
- or Enter - 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]
- or p - Paste from clipboard
- ` - Toggle console overlayq
- - Quit openmuxd
- - Detach (leave session running in background)Esc
- - Exit prefix mode
- h/j/k/l - Move focused pane west/south/north/eastEsc
- - Exit move mode
- Ctrl+n - Next matchCtrl+p
- - Previous matchEnter
- - Confirm selection and jumpEsc
- - Cancel searchBackspace
- - Delete last character
- ↑ / ↓ - Navigate commandsEnter
- - Execute selected commandEsc
- - Close command paletteBackspace
- - Delete last character
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
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
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
- h / ← or l / → - Focus confirm/cancelTab
- - Toggle between confirm/cancelEnter
- - ConfirmEsc
- - Cancel
Enable via the command palette ("Toggle overlay vim mode"), or in config.toml:
`toml`
[keyboard]
vimMode = "overlays"
vimSequenceTimeoutMs = 1000
When 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 moden
- Search overlays: / N for next/prev match
- 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.
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.
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 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).
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_WIDTH
- OPENMUX_MIN_PANE_HEIGHT
- OPENMUX_STACK_RATIO
- (maps to layout.defaultSplitRatio)
To unbind a keybinding, set its value to null or "unbind".
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.
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/k in overlay vim mode), Enter to interact, Prefix+Esc` to return to list
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
MIT