I am using screen on OS X. I have two bind commands:
bind ( eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'" bind ) eval "exec sh -c 'pbpaste > /tmp/screen-exchange'" "readbuf"
The first one takes what is in the copy buffer and sends it to pbcopy. pbcopy is a program that takes an input and writes it to the system clipboard. This command works.
The second one is suppose to write pbpaste ( from the system clipboard ) to the screen-exchange file and then read that with readbuf. This command doesn't work. I have to enter the bound key , ctrl-a ), twice for it to work. I assume I am missing something simple. Any help would be great.
Note: If I just do the
pbpaste > /tmp/screen-exchange and then in
ctrl-a <, it works. So I think the pbpaste command is
correct, there is just something that I am missing in the bind. Any help would be
EDIT: I'm still looking for a complete solution for this to be bound to one key. In the meantime, I can use the following bind and key strokes:
bind ) eval "exec sh -c 'pbpaste > /tmp/screen-exchange'"
ctrl-a ) ctrl-a <
What is happening is that I'm writing my pbpaste to the screen-exchange file and then manually executing the readbuf command. As I said, I would still like a way to do this in one command. Any help would be great.