tmux-copyrat — highlight and copy pattern-matched text from tmux panes
prefix + t + key — search visible area
prefix + T + key — search entire scrollback
tmux-copyrat scans the active tmux pane for text matching a named pattern (URLs, IPs, SHAs, paths, etc.), overlays single/double-character hints on each match, and copies the selected span to the tmux buffer or system clipboard.
Inspired by tmux-copycat and tmux-thumbs.
prefix + t + h highlights SHA hashes with copyable hints:
| Key | Pattern |
|---|---|
| a | command-line args |
| c | hex color codes |
| d | dates / datetimes |
| D | Docker/Podman IDs |
| e | email addresses |
| G | 4+ digit strings |
| h | SHA-1/2 hashes |
| m | markdown URLs |
| p | file paths |
| P | pointer addresses |
| q | quoted strings (single/double/backtick) |
| u | URLs |
| U | UUIDs |
| v | version numbers |
| 4 | IPv4 addresses |
| 6 | IPv6 addresses |
| space | all patterns |
| / | custom regex (prompted) |
| Key | Action |
|---|---|
| hint chars | copy span and exit |
| CAPS hint | copy to system clipboard |
| n / N | next / previous span |
| y | yank focused span (tmux buffer) |
| Y | yank focused span (clipboard) |
| Space | toggle output destination |
| Esc | cancel |
Multi-select mode adds Tab (toggle focused span) and Enter (confirm selection). See CONFIGURATION.md.
copyrat reads from stdin and writes the selected span to stdout, with no tmux
dependency:
git log | copyrat -r -u -x sha -x datetime | pbcopyMulti-select is supported via -m (and -S for separator):
echo "127.0.0.1 and 192.168.1.1 and [email protected]" | copyrat -A -m- INSTALLATION.md — install via TPM, manual clone, or Homebrew
- CONFIGURATION.md — colors, alphabets, custom bindings, multi-select
- CONTRIBUTING.md — development setup, code coverage
MIT — Copyright 2022 graelo

