Something went wrong. Try again.
the tui'est alt-tab of tmux's you'll find.
Something went wrong. Try again.
Files
- TypeScript 99%
- JavaScript 1%
README.md
altmux #
the tui'est alt-tab of tmux's you'll find.
Fullscreen terminal UI for browsing tmux sessions and windows. Renders a live pane buffer preview and lets you cycle, search, and attach — without leaving the keyboard.
Requirements #
- Node.js 25+
- tmux 3.6+
Quick start #
pnpm install
node alt-mux.ts
Usage #
alt-mux [options]
Keybindings #
| Key | Action |
|---|---|
h / ← |
move backward along axis |
l / → |
move forward along axis |
' |
session picker (fuzzy) |
G |
goto — attach to the displayed session/window |
r |
refresh |
q |
quit |
Axis options #
| Flag | Description |
|---|---|
--horizontal, -H |
cycle across sessions (default) |
--vertical, -V |
cycle across windows within the current session |
Sort options #
| Flag | Description |
|---|---|
--sort <field> |
sort by any tmux session format field |
--descending, -d |
reverse sort order |
View options #
| Flag | Description |
|---|---|
--quiet, -q |
hide bottom status bar |
--clip <mode> |
clip mode: vertical (default), horizontal, both, or off |
--search <regex>, -s |
highlight matches in pane output |
Examples:
alt-mux --sort session_created
alt-mux --sort session_activity --descending
alt-mux --vertical --sort session_last_attached --descending
alt-mux --search "error|warn"
alt-mux --quiet
How it works #
- Reads tmux state with
tmux list-sessionsandtmux list-windows - Reads pane output with
tmux capture-pane -p -e - Renders into an alternate screen buffer with in-place redraws
Gcleans up the alternate screen and execstmux a -dt <target>
Architecture #
The project uses a functional-core + plugin-shell split, built on gunshi.
src/tmux/ — functional core #
Library-like modules with no gunshi dependency.
| File | Responsibility |
|---|---|
transport.ts |
thin tmux command execution |
sessions.ts |
session listing and arbitrary field sorting |
windows.ts |
window and pane metadata queries |
capture.ts |
pane capture behavior |
types.ts |
shared tmux model types |
src/plugins/ — stateful shells #
Each plugin owns its own state and exposes a contract through extension methods.
| Plugin | State |
|---|---|
tmux |
exposes core functions as extension methods |
axis |
session or window axis + args |
sessions |
sort state (--sort, --descending) + args |
view |
quiet, clip mode, search pattern + args |
Command composition #
src/commands/browse.ts composes plugin-owned args, applies them to plugin state, and hands off to the TUI renderer.
Development #
pnpm check # lint + typecheck
pnpm test
pnpm dev # run directly