Do not clear clipboard after an application exits

340 views
Skip to first unread message

Scott Kostyshak

unread,
Nov 17, 2019, 11:07:44 PM11/17/19
to CopyQ
I remember conversations on this in the past but I can't seem to find
them.

If I copy something in Chromium, and then I exit Chromium, the clipboard
is cleared so that I have to open CopyQ and select the recently saved
item. I would prefer not to have to do this. That is, if an application
clears the clipboard, I would prefer to just have that ignored. I think
I saw a CopyQ command that does that but I can't find it now. I enabled
the command with description "Ignore items with no or single character"
but that didn't change anything as far as I could tell.

From what I understand, the default behavior of CopyQ is to follow the
application's request. If the application (or OS?) requests the
clipboard to be cleared on an application's exit, then CopyQ is just
respecting that request. Is that interpretation correct?

By the way, I have not checked the behavior of CopyQ without my many
customizations, so if what I'm describing is not the default behavior,
let me know and I'll figure out what it is on my end that causes this. I
didn't do this yet since I think it is the expected default behavior of
CopyQ.

Thanks,

Scott

Lukáš Holeček

unread,
Nov 21, 2019, 7:16:00 AM11/21/19
to CopyQ
Yes, by default, CopyQ doesn't do anything with clipboard, unless you have synchronization from X11 selection enabled or copy an item explicitly.

If you want CopyQ to reset last clipboard after it was cleared, you can use "Reset Empty Clipboard/Selection" command [1].

BTW, when using the command, the reset content will show in GUI as "<HIDDEN>" because it could come originally from a password manager.


Lukas


--
You received this message because you are subscribed to the Google Groups "CopyQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to copyq+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/copyq/20191118040741.tg2fzc44m3sdajqe%40tallinn.

Scott Kostyshak

unread,
Nov 21, 2019, 11:06:02 AM11/21/19
to CopyQ
Thanks for your reply, Lukáš. I just tried that but unless I
misunderstood something it didn't work as I expected. I copied the text
in my webbrowser of that script, and pasted it in to the CopyQ commands
window. I received notification of a CopyQ Exception (see attachment
screenshot.png). Attached also is a screenshot of the command after
pasting it in.

When I copy something in Chromium, and then exit Chromium, I still have
to manually select the item for it to paste.

One other thing that I noticed is that for the other CopyQ commands,
they all seem to have as the first line "copyq:", whereas the "Reset
Empty Clipboard/Selection" command does not.

Perhaps something isn't working as properly since I have many other
commands activated (as shown in the screenshot)?

Thanks,

Scott
> To view this discussion on the web visit https://groups.google.com/d/msgid/copyq/CAAMGTDyaTcg1N7N59jfpX%2BBdkd3nd8Gzhk6n%2BxQQ1t%2Bg7WWgQA%40mail.gmail.com.
command.png
exception.png

Lukáš Holeček

unread,
Nov 22, 2019, 2:35:04 AM11/22/19
to CopyQ
I've updated the command [1], can you try to add it again to CopyQ?


Scott Kostyshak

unread,
Nov 29, 2019, 11:56:29 AM11/29/19
to CopyQ
(bringing the coversation back to the list, sorry about that)

When I type that command in to the action dialog after exiting Chromium
(I do not copy/paste because I'm worried that will mess it up), I get a
popup in the bottom-right corner that has the following:

(i) formats
text/plain
TARGETS
TIMESTAMP

Does that information help?

Thanks,

Scott


On Fri, Nov 22, 2019 at 11:05:04PM -0500, Scott Kostyshak wrote:
> Oops, I'm sorry I took the conversation off-list. That was not my
> intention.
>
> I"m traveling now and can try your new suggestion next week.
>
> Thanks for your help,
>
> Scott
>
>
> On Fri, Nov 22, 2019 at 04:34:24PM +0100, Lukáš Holeček wrote:
> > Hmm, maybe hasData() returns incorrect result (it's expected to be false
> > when the clipboard is empty).
> >
> > After the clipboard is cleared (e.g. closing the Chromium), can you launch
> > following command in Action dialog (F5 shortcut) and pasting the format
> > list it copies?
> >
> > copyq:
> > var formats = clipboard('?')
> > popup('formats', formats)
> > copy(formats)
> >
> >
> > On Fri, Nov 22, 2019 at 3:52 PM Scott Kostyshak <scott.k...@gmail.com>
> > wrote:
> >
> > > Thanks for taking a look. I tried the new command and don't get an
> > > exception but I still have the same behavior.
> > >
> > > Scott
> > > https://groups.google.com/d/msgid/copyq/20191121160552.w2qlaytymv5bdcyy%40tallinn
> > > > > .
> > > > >
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > Groups "CopyQ" group.
> > > > To unsubscribe from this group and stop receiving emails from it, send
> > > an email to copyq+un...@googlegroups.com.
> > > > To view this discussion on the web visit
> > > https://groups.google.com/d/msgid/copyq/CAAMGTDytWsJNYz%3Dx1k%3DASDBD5EKPe_5Jbg3L5xGS8-U5N3%3DuAA%40mail.gmail.com
> > > .
> > >

Lukáš Holeček

unread,
Nov 30, 2019, 2:16:29 AM11/30/19
to CopyQ
Looks like there is still some text in clipboard, so the "reset" command doesn't consider it cleared.

You can check "copyq clipboard" to see what's in the clipboard.

Lukas

Scott Kostyshak

unread,
Dec 1, 2019, 12:12:42 PM12/1/19
to CopyQ
I can now only reproduce the issue sporadically. I'll keep an eye on it
and try to figure out a pattern. I'll post back if I can get more
information.

Thanks for your help!

Scott
> To view this discussion on the web visit https://groups.google.com/d/msgid/copyq/CAAMGTDxcVaPk0eeqf8EJTJ-3X9YBzrHYz%2BWmXXPvq2Md7ji8bA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages