Skip to content

graelo/tmux-copyrat

Repository files navigation

tmux-copyrat

build status rustc 1.95+ edition 2024 crate tmux 3.0+

Name

tmux-copyrat — highlight and copy pattern-matched text from tmux panes

Synopsis

prefix + t + key — search visible area
prefix + T + key — search entire scrollback

Description

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.

Demo

prefix + t + h highlights SHA hashes with copyable hints:

tmux-copyrat-hashes.png

Default Keys

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)

Runtime Controls

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.

Standalone Binary

copyrat reads from stdin and writes the selected span to stdout, with no tmux dependency:

git log | copyrat -r -u -x sha -x datetime | pbcopy

Multi-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

copyrat-output.png

See Also

License

MIT — Copyright 2022 graelo

About

tmux-copycat on Rust steroids

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors