Re: Trying to get clipboard into paste buffer

David Woodfall <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <20180531134851.GA7807@blackswan>
On Thursday 31 May 2018 14:12,
Amadeusz Sławiński <[email protected]> put forth the proposition:
> On Wed, 30 May 2018 23:46:44 +0100
> David Woodfall <[email protected]> wrote:
>
> > I'm using the following bind to get the x clipboard into the paste
> > buffer and then paste it:
> >
> > bind P eval 'exec sh -c "xsel -n -o -b > /tmp/screen-exchange"' 'readbuf' 'paste .'
> >
> > There seems to be some kind of timing problem, because readbuf seems
> > to execute before xsel has pasted and pastes the old contents of
> > screen-exchange. If I execute it twice, it works as it should.
> >
> > If I just have the xsel command it does copy into screen-exchange so
> > I know that that's working, and I can then run 'c-a < c-a ]' and it
> > works that way too.
> >
> > I tried adding a sleep command in there but it didn't make any
> > difference.
> >
> > Any ideas on how to get this working?
> >
>
> Hi,
>
> You are under wrong impression that exec should be used to run commands.
> It is complicated way to run "filter" windows which perform redirects
> between filter command, window file descriptors and display file
> descriptors.
> While as side effect it probably does a bit of what you expect (ie. runs
> the shell command) it's rather bad way to do this.
>
> If anything I would look for some program that monitor clipboard for
> changes and writes to /tmp/screen-exchange independently of screen
> and just bind readbuf.
>
> But as you said in other mail, you can just paste directly into screen
> with mouse or terminal.
>
> Cheers,
> Amadeusz

Thanks for the info. I hadn't read the 'exec' section of the manual
before, but I see what you mean now.

-Dave

--

Convention organizer to Linus Torvalds: "You might like to come with us
to some licensed[1] place, and have some pizza."

Linus: "Oh, I did not know that you needed a license to eat pizza".

[1] Licenced - refers in Australia to a restaurant which has government
licence to sell liquor.
  -- Linus at a talk at the Melbourne University

                                                            .--.  oo
                                                           (____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

_______________________________________________
screen-users mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/screen-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.