Skip to content

Instantly share code, notes, and snippets.

@movsb movsb/pbcopy
Created May 22, 2020

Embed
What would you like to do?
A MacOS pbcopy implementation for linux servers.
#!/bin/bash
set -euo pipefail
t=$(cat <&0 | base64 --wrap=0)
if [ ! -z ${STY+x} ]; then
echo -ne "\eP\e]52;c;$t\a\e\\"
elif [ ! -z ${TMUX+x} ]; then
echo -ne "\ePtmux;\e\e]52;c;$t\a\e\\"
else
echo -ne "\e]52;c;$t\a"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.