This commit is contained in:
2026-08-27 10:23:08 +01:00
parent 4be1b00083
commit 546a85709c
2 changed files with 3 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# Clipboard handy snippets
## tmux remote session wl-copy style
insert this into bashrc on remote computer
```
clip() {
local input
if [ -t 0 ]; then
input="$*"
else
input=$(cat)
fi
printf "\033]52;c;%s\007" "$(echo -n "$input" | base64)" > "$(tmux display-message -p '#{client_tty}')"
}
```
you can then do something like `clip "literal string"`
and you have `literal string` in your clipboard on the remote host also, this is assuming you use tmux on in a ssh session, and this script is in .bashrc on the remote machine okay?
to pipe the result of whatever do something like this `sudo systemctl status firewalld | clip`
and that output is in your clipboard