Checklist
Output of fzf --version
0.73.1 (ae78a5c)
OS
Shell
Problem / Steps to reproduce
Issue: often used snippet, but macOS only; will fail when using same setup on a non-mac
fzf --bind 'enter:execute:echo -n {1} | pbcopy'
Solution: OS-independent way to copy a string to clipboard
fzf --bind 'enter:copy-string:{1}'
a paste action seems redundant, user already has ⌃ ControlV / ⌘ CommandV
one possible use case was accessing the clipboard value, e.g. through a placeholder (not important)
# popup that disappears after 2s; modified example from CHANGELOG.md 0.63.0
echo "https://example.com" | fzf \
--bind "ctrl-y:copy-string:{}" \
--bind "ctrl-y:+change-footer:{input_paste}" \
--bind "ctrl-y:+bg-cancel+bg-transform-footer:sleep 2"
tools with clipboard feature
broot (rust)
| name |
key |
description |
| copy_line |
alt-c |
copy selected line (in tree or preview) |
| copy_path |
|
copy path to system clipboard |
| input_paste |
ctrl-v |
paste the clipboard content into the input |
# needs to be built with feature flag (brew formula does not set it)
cargo install broot --features clipboard
# run
~/.cargo/bin/broot
# press 'alt-c' on selected item
# press 'ctrl-v' to paste
television (rust)
handles it without a dedicated crate
| name |
key |
| copy_entry_to_clipboard |
ctrl-y |
additional notes
some terminals support OSC 52 (ghostty, VSCode 1.91+, ...)
printf "\033]52;c;%s\007" "$(printf "FooBar" | base64)"
related issues
Checklist
man fzf)Output of
fzf --version0.73.1 (ae78a5c)
OS
Shell
Problem / Steps to reproduce
Issue: often used snippet, but macOS only; will fail when using same setup on a non-mac
fzf --bind 'enter:execute:echo -n {1} | pbcopy'Solution: OS-independent way to copy a string to clipboard
fzf --bind 'enter:copy-string:{1}'a
pasteaction seems redundant, user already has ⌃ ControlV / ⌘ CommandVone possible use case was accessing the clipboard value, e.g. through a placeholder (not important)
tools with clipboard feature
broot(rust)television(rust)handles it without a dedicated crate
additional notes
some terminals support OSC 52 (ghostty, VSCode 1.91+, ...)
related issues