Bug Report: Text is pasted incorrectly in Anki when PopClip is running

Hello. Unfortunately, I recently encountered a bug while working in the Anki app when PopClip is launched (running in the background). For some reason, when copying or cutting text in Anki and then pasting it, the text may be pasted incorrectly. Sometimes (not always, but quite often), the latest copied/cut text is not pasted, and instead, the previous one is pasted.

Here is a demonstration of this issue:

popclip issue demonstration 1

In these demonstration, the text was selected with a mouse, cut using the ⌘X keyboard shortcut, and pasted back into place using the ⌘V shortcut. This issue does not occur when PopClip is not running, and it has not occurred in any other app except Anki, according to my investigation.

When I first encountered this bug, I initially thought there was a problem with my macOS, so I reinstalled it, but that did not resolve the issue. Then I suspected the problem was with the Anki app, so I reinstalled it several times and tried installing previous versions of Anki, but the issue persisted. I then closed all third-party apps on my computer and began launching them one by one to try to replicate the issue in Anki. The issue started occurring when I launched PopClip.

I have spent 2 days trying to identify the source of the problem. It’s a very annoying bug. Please fix it.

macOS 12.7.4
PopClip 2024.3.1 (2413)
Anki 23.12.1 (1a1d4d54)⁩

Here is another demonstration of the issue:

popclip issue demonstration 2

Thank you for the report. For now I recommend adding Anki to the Excluded Apps list.

CleanShot 2024-03-25 at 09.52.44@2x

And I was so triumphant to announce support for Anki only last week …!

I will fix it if possible, but it may be that Anki’s weird internals mean I can’t. In which case I may have to block it again by default :frowning:

1 Like

Why not add it to the exclude list as a factory setting, so users without issues can still use it?

Yes, that would make the most sense.

So it’s basically because Anki is a bit slow in responding, so if you press ⌘C or ⌘X very quickly after selecting text, PopClip’s text-detecting dance might put the old text back.

Been an issue in a few apps since the beginning. I’ve always been trying to minimize it as much as possible.

One “trick” (not just in Anki but in other apps that suffer this) is to get into the habit of holding the ⌘ key while performing the selection, then press the C. This suppresses PopClip from trying to pop up.

1 Like