| Crates.io | tmux-snaglord |
| lib.rs | tmux-snaglord |
| version | 0.1.4 |
| created_at | 2025-12-19 15:58:17.484107+00 |
| updated_at | 2025-12-27 10:44:35.732548+00 |
| description | A TUI application to make copying terminal history from tmux easier |
| homepage | https://github.com/raine/tmux-snaglord |
| repository | https://github.com/raine/tmux-snaglord |
| max_upload_size | |
| id | 1995034 |
| size | 339,925 |
Reign over your tmux scrollback.
Stop scrolling through walls of terminal text. tmux-snaglord turns your tmux
scrollback into a structured, searchable list of commands and their outputs.
Install · Quick start · Usage · Configuration

Tmux copy-mode requires you to scroll, visually locate boundaries, and manually
select text. Command and output boundaries blur together. tmux-snaglord solves
this by detecting prompts and treating each command + output as a single
selectable block.
; or search all visible panes at once/brew install raine/tap/tmux-snaglord
cargo install tmux-snaglord
tmux-snaglord init in a tmux pane with some command history~/.tmux.conf:# Open in a popup (tmux 3.2+)
bind-key C-y popup -E -w 60% -h 60% "tmux-snaglord"
See Prompt detection if auto-detection doesn't work.
When working with Claude Code, Aider, or similar tools, you often need to share command output from another pane:
; to load history from your previous panep to paste directly into the conversationtmux-snaglord # Run the TUI
tmux-snaglord init # Auto-detect prompt and save to config
tmux-snaglord -t "%1" # Target a specific pane
Usage: tmux-snaglord [OPTIONS]
Options:
-p, --prompt <REGEX> Regex pattern to identify command prompts
--preset <NAME> Preset pattern name (bash, zsh, fish, robbyrussell, starship, dollar, hash)
-t, --target <PANE> Target tmux pane (e.g., "%0", "session:window.pane", or "previous")
-m, --mode <MODE> Start in specific view mode [possible values: commands, json, paths]
-a, --all Start in all-panes mode (search across all visible panes)
The special target previous captures the last active pane, useful when you
want to run the tool from a different pane than the one you're inspecting.
Navigation
| Key | Action |
|---|---|
j / ↓ |
Next item |
k / ↑ |
Previous item |
Ctrl+d |
Scroll output down |
Ctrl+u |
Scroll output up |
1 / 2 / 3 |
Switch to Commands / JSON / Paths |
Tab |
Cycle to next mode |
/ |
Enter search mode |
Selection & copying
| Key | Action |
|---|---|
Space |
Toggle selection (scratchpad) |
Enter |
Copy full (command + output) |
y |
Copy output only |
Y |
Copy full (command + output) |
c |
Copy command only |
p |
Paste output to original pane |
P |
Paste full to original pane |
D |
Copy debug format (raw with escapes) |
Esc |
Clear selection/search, or quit |
q |
Quit |
Pane navigation
| Key | Action |
|---|---|
; |
Cycle pane source (this → previous → all) |
a |
Jump to all-panes mode |
Use ; to cycle between viewing history from the current pane, the previous
pane, or all visible panes in the window. Press a to jump directly to
all-panes mode. Paste actions (p/P) always target the original pane where
the tool was launched.
Search mode
| Key | Action |
|---|---|
| (type) | Filter items |
Enter |
Exit search, keep filter |
Esc |
Clear search and exit |
Ctrl+n / Ctrl+p |
Navigate while searching |
tmux-snaglord captures the visible content of your tmux pane and uses a regex
pattern to find shell prompts. Each prompt marks the start of a new command, and
everything until the next prompt is that command's output:
~/code % ls ← prompt detected, "ls" is the command
file1.txt
file2.txt ← output
~/code % cat file1.txt ← next prompt, new command starts
hello world ← output
If no commands are found, run tmux-snaglord init to auto-detect the best
preset for your shell, or configure a custom pattern.
Note: Because this tool relies on regex pattern matching, detection accuracy depends on your prompt configuration. Heavily customized prompts or command output that resembles your prompt may cause incorrect parsing.
You can persist preferences in ~/.config/tmux-snaglord/config.toml:
# Use a built-in preset
preset = "starship"
# OR define a custom regex (takes precedence)
# prompt = "^[/~].* % "
# Enable Nerd Font icons and Powerline glyphs (default: false)
# nerd_fonts = true
| Name | Pattern | Description |
|---|---|---|
bash |
^[\w.-]+@[\w.-]+:[~\w./-]+[#$] |
Standard bash (user@host:path$) |
zsh |
^[\w.-]+% |
Default zsh (hostname%) |
fish |
^.*?[\w./-]+> |
Fish default prompt |
robbyrussell |
^➜ |
Oh My Zsh robbyrussell theme |
starship |
^❯ |
Starship default prompt |
dollar |
^\$ |
Simple $ prompt |
hash |
^# |
Root shell prompt |