Last active
January 5, 2025 08:39
-
-
Save azlan/c664baaf3694f3160f2bbd4f04af8066 to your computer and use it in GitHub Desktop.
Bash script to copy terminal clipboard to OS clipboard with OSC52 from remote ssh session
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 | |
printf "\033]52;c;%s\007" "$(base64 | tr -d '\n')" | |
# https://jvns.ca/til/vim-osc52/ | |
# Instructions: | |
# $ sudo nano /usr/local/bin/pbcopy | |
# paste this script | |
# $ sudo chmod +x /usr/local/bin/pbcopy | |
# example usage: | |
# $ ls | pbcopy | |
# if it's not working on your terminal emulator, read this: | |
# https://github.com/zyedidia/micro/blob/master/runtime/help/copypaste.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment