osx - Unable to have pbcopy -clipboard inside Screen -
The problem was not solved despite accepting an answer: We worked to do Jonah Are working to get the code.
Problem: (1) to change the code (2)
I know I want to be able to run the following code inside the screen I
Code (1)
cat ~ / .vimrc | Pbcopy (1) Code (2)
cat ~ / Vimrc & gt; /tmp/pbcopy.pipe (2) My attempt to resolve this problem: .zshrc
function pbcopy () {"(Cat \" $ 1 \ ")" & gt; /tmp/pbcopy.pipe} I get
cat massey | Pbcopy pbcopy: Command not found: (cat "") cat: masi: Any such file or directory How can you use pbcopy inside the screen?
OK, this is a bad answer, but this is also a mistake, so at least they match We do. You can create a named pipe, and then setup an endless loop that reads the files from the designated pipe and gives them pbcopy (or xsel , xclip code>, etc.).
1. In a terminal which is not in a screen session (run it only once):
/ Usr / bin / mkfifo /tmp/pbcopy.pipe While correct; Do / bin / cat /tmp/pbcopy.pipe | / Usr / bin / pbcopy; If you want to change it to a shell script (it should probably be stronger)
#! / Bin / bash if [[-e /tmp/pbcopy.pipe]]; Then echo "It seems that I am already running" echo "removing /tmp/pbcopy.pipe If you are certain that I am not right then" exit 1 "Do / bin / cat / tmp / pbcopy .pipe | / Usr / bin / pbcopy which you can name as pbcopy_server.sh , make executable ( chmod a + x Pbcopy_server.sh ) and somewhere on your own, so that you can call nohup pbcopy_server.sh & amp; when you start your machine for the first time.
cat file> Tmp / pbcopy.pipe df -h & gt; /tmp/pbcopy.pipe 3. To see if you are the actual Pbcopy You can use something to cat'ing for /tmp/pbcopy.pipe .
3a. Zsh function:
function pbcopy () {cat> /tmp/pbcopy.pipe} 3b Create a Perl script named or pbcopy and place it in the directory in your / usr / bin : < / P>
#! Use / usr / bin / perl strict; Use warnings; Open my $ out, "& gt;", "/tmp/pbcopy.pipe" or die "Could not open pbcopy: $! \ N"; Print out $ _ $ & lt; & Gt ;;
Comments
Post a Comment