Skip to content

Instantly share code, notes, and snippets.

@movsb
Created May 22, 2020 12:28
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