Skip to content

About

Quickly copy text from a tmux pane by searching and selecting it with labeled keys

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

123 Commits

Folders and files

Repository files navigation

flash.tmux

Standalone Rust CLI for a tmux "flash copy" workflow inspired by flash.nvim and flash-copy.tmux.

Quickly copy text from a tmux pane by searching and selecting it with labeled keys.

Requirements

  • tmux 3.8 or newer for modal floating panes.
  • Clipboard support via tmux set-buffer -w (OSC52-capable terminal).

Rendering uses synchronized output (also called synchronized updates or batched rendering) to reduce flicker while updating search results.

Install

From crates.io:

cargo install flash_tmux

From source:

git clone https://github.com/iovis/flash.tmux
cd flash.tmux
cargo install --path .

tmux setup

Add a binding in ~/.tmux.conf:

bind-key F run-shell "flash_tmux"

Usage

The search UI opens in a borderless modal floating pane over the source pane and closes after selection or cancellation.

  • Type to search (ASCII case-insensitive).
  • Labels are lowercase; press a label to select.
    • Lowercase: copy + paste.
    • Uppercase: copy only.
  • Tab: paste current match
  • Enter: paste and send Enter.
  • Space: paste and send Space.

Options

  • -r, --reverse-label: Reverse label behavior.
    • Lowercase: copy only.
    • Uppercase: copy + paste.

Matching behavior

  • Only the visible pane content can be matched.
  • Matches are whitespace-delimited tokens.
  • Substring matches within a token are allowed.
  • If a token is wrapped by (), [], {}, quotes, or backticks, and the match is inside those wrappers, the outer wrapper is stripped before copying/pasting.
    • Example: (/home/user/project) → /home/user/project
  • Matches that would copy or paste exactly the same text share a label.
    • Example: foo, (foo), and "foo" may share a label because the surrounding wrappers are stripped.
    • Grouping is case-sensitive, so foo and Foo use different labels.

Benchmarks

Standalone benchmark binaries live in src/bin/ (on the bench branch) and are intended for comparison with the C and Odin sibling implementations.

Build release binaries and verify checksum parity:

just release
just checksums

Expected checksum output:

1787
4278
5838609766282676217

Run Rust-only benchmarks with hyperfine:

just bench-search
just bench-incremental
just bench-render
just bench

The benchmark recipes use ../flash-bench-content.txt by default and accept optional copies, iterations, and runs parameters. For example:

just bench-search 500 50 10

About

Quickly copy text from a tmux pane by searching and selecting it with labeled keys

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages