CLI
| Command / Flag | Description |
|---|---|
save | Save current or selected sessions to disk |
restore --session NAME | Restore a single session from disk |
picker | Open session picker and restore selected session (default: TUI) |
bootstrap [--session last|NAME] | Restore one session automatically at tmux startup |
daemon [--interval DURATION] | Periodically save all sessions in the background |
list | List saved sessions |
version (--version, -v) | Print the version |
config gen / config show | Write a base config file, or print the effective config lazy-tmux actually reads |
wakeup --session NAME | Restore a saved session (lazy load) that is not currently running |
sleep --session NAME [--scrollback] [--scrollback-lines N] | Save session state (with optional scrollback) and close a running session |
--fzf-engine | Use fzf backend instead of built-in TUI |
--fzf-engine --windows | fzf backend: list and pick a specific window (not just a session), then restore its session focused on it |
--restore-timeout DURATION | Max wait for restored pane commands to start before the command returns (e.g. 5s; 0 disables waiting) |
--session-sort EXPR | Session sort (field[:asc|desc],...) fields: last-used, captured, name, windows, panes |
--window-sort EXPR | Window sort (field[:asc|desc],...) fields: index, name, panes, cmd |
--scrollback | Capture shell pane scrollback (opt-in) |
--scrollback-lines N | Maximum captured lines per shell pane (default: 5000) |
Sorting examples
# Sort sessions by name, then by captured time (newest first)
lazy-tmux picker --session-sort "name:asc,captured:desc"
# Sort windows by pane count, then by name
lazy-tmux picker --window-sort "panes:desc,name:asc"
# Use same sorting with fzf backend
lazy-tmux picker --fzf-engine --session-sort "last-used:desc,name:asc"
# fzf backend, but pick an individual window instead of a whole session
lazy-tmux picker --fzf-engine --windows --window-sort "name:asc"Sorting behavior
Default directions (when :asc|:desc is omitted):
- sessions:
name=asc, all other session fields =desc - windows:
index=asc,name=asc, all other window fields =desc
Current defaults (if no sort flags are passed):
- sessions:
last-used:desc,captured:desc,name:asc - windows:
index:asc,name:asc
Validation behavior:
- unknown fields are rejected with an error.
- invalid direction values are rejected (
ascanddesconly). - duplicate fields in one expression are rejected.
Scrollback capture
By default, scrollback capture is disabled. Enable it explicitly:
lazy-tmux save --all --scrollback --scrollback-lines 5000
lazy-tmux daemon --interval 5m --scrollback --scrollback-lines 5000Behavior:
- captures tmux pane scrollback only for panes that currently run an interactive shell (no detected foreground app command).
- stores scrollback as sidecar files and references them from session snapshots.
- on restore, writes captured scrollback back into pane tty before command replay.
Storage layout:
~/.local/share/lazy-tmux/sessions/*.json~/.local/share/lazy-tmux/scrollback/<session>/*.log
Storage
Default directory:
~/.local/share/lazy-tmux/index.json~/.local/share/lazy-tmux/sessions/*.json~/.local/share/lazy-tmux/scrollback/*
Override via:
- env:
LAZY_TMUX_DATA_DIR - flag:
--data-dir - config:
data_dirin the TOML config file (see the Configuration page)