Gentoo Archives: gentoo-user

From: Ian Zimmerman <itz@××××××××××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Weird firefox
Date: Sun, 03 Jun 2018 02:09:17
Message-Id: 20180603020901.khfhajy5odtgvtha@matica.foolinux.mooo.com
In Reply to: Re: [gentoo-user] Re: Weird firefox by Arve Barsnes
1 On 2018-06-03 00:02, Arve Barsnes wrote:
2
3 > What programs are you making the copy from, and in what way? I have
4 > not had this kind of problem with firefox, but notepadqq's copy/paste
5 > functionality seems to be messed up for me.
6
7 Thanks for your question, which made me take a closer look and led to a
8 solution.
9
10 I was stuffing the clipboard with the xclip(1) program, in a script that
11 historically looked like this (only slightly simplified):
12
13 xclip -o | xclip -i -selection c
14
15 The left side of the pipe takes the selection, which is a transient
16 thing, and echoes it on stdout; the right side reads that on stdin and
17 stuffs it into the long-lived clipboard. At some point I became worried
18 that this may be hazardous, because by default the clipboard is
19 available forever (limited to a single session of X of course). I
20 thought if I forget what I put into the clipboard pasting it could have
21 unexpected results. So I changed the above to:
22
23 xclip -o | xclip -i -loops 1 -selection c
24
25 This makes the clipboard available for exactly 1 access. But it turns
26 out firefox, for whatever reason, grabs the clipboard _twice_ before it
27 actually pastes it into the urlbar, and so the second time was
28 failing and aborting the whole paste operation. Now I changed it to
29 -loops 2 and it works again.
30
31 Dragons indeed!
32
33 --
34 Please don't Cc: me privately on mailing lists and Usenet,
35 if you also post the followup to the list or newsgroup.
36 To reply privately _only_ on Usenet and on broken lists
37 which rewrite From, fetch the TXT record for no-use.mooo.com.