Created
May 22, 2020 12:28
-
-
Save movsb/30beb738148f971865c1d28947fed9e5 to your computer and use it in GitHub Desktop.
A MacOS pbcopy implementation for linux servers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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