Unwanted letters
While doing copying of texts COPYQ. displays unwanted letters. See attachment.
This problem happens while I'm using COPYQ. in Linux Mint 21.1 in the XFCE. desktop environment. I also have MS. Windows 11 in the same laptop, Dell Inspiron as Linux Mint 21.1. I use GRUB. to load one OS. or the other. I don't have this problem while I'm using COPYQ. in MS. Windows 11.
I've used "Klipper" in KDE. running in OpenSuSe. I haven't seen this same problem there, either.
Thanks.
Nicholas E. Haniotis.
I think this is not a bug, but some misbehaving app putting a single letter to clipboard, or more likely mouse selection buffer. I have the same problem with WhatsApp web app (running in Firefox).
I use the following command to avoid this problem (here is how to add the command to CopyQ):
[Command]
Command="
const re = /^\\s*.?\\s*$/;
function hasEmptyOrSingleCharText(textData) {
return re.test(str(textData));
}
var onClipboardChanged_ = onClipboardChanged;
onClipboardChanged = function() {
if (dataFormats().includes(mimeText) && hasEmptyOrSingleCharText(data(mimeText))) {
serverLog('onClipboardChanged: Ignoring text with single or no character');
clearClipboardData();
return;
}
onClipboardChanged_();
}
var synchronizeFromSelection_ = synchronizeFromSelection;
synchronizeFromSelection = function() {
if (hasEmptyOrSingleCharText(selection(mimeText))) {
serverLog('synchronizeFromSelection: Ignoring text with single or no character');
clearClipboardData();
return;
}
synchronizeFromSelection_();
}
var synchronizeToSelection_ = synchronizeToSelection;
synchronizeToSelection = function() {
if (hasEmptyOrSingleCharText(clipboard(mimeText))) {
serverLog('synchronizeToSelection: Ignoring text with single or no character');
clearClipboardData();
return;
}
synchronizeToSelection_();
}"
Icon=
IsScript=true
Name=Ignore Single Character Copy
I think the predefined command "Ignore items with no or single character" could also work for you (find it in the command list after clicking Add button in the Commands dialog).
hluk.
Hope all is well.
Thanks for responding to this.
Let me ask you a question then. Why doesn't this issue happen at all when I use CopyQ in MS. Windows and it only happens in CopyQ running in Linux Mint 21?
I never used "Whatsapp". And, FYI. I'm not a "Linux Sysadmin.". I'm just a "Linux End User". I don't feel comfortable using the command line in Linux Mint 21 for "mission critical" work or to fix issues. For me to try & learn the commandline in Linux is like trying to learn Ancient Greek. I'm fluent in Greek which is Contemporary Greek only. Ancient Greek is a difficult language to master from what I've heard. I don't understand Ancient Greek.
Windows and it only happens in CopyQ running in Linux Mint 21?
I think the problem is that some applications modifies the primary selection buffer incorrectly. This kind of clipboard is not supported on Windows.
I also have a similar problem with Qt Creator, where it copies whole words when searching.
The primary selection should be only modified when user selects text with mouse, but some UI frameworks do not follow this (I think GTK was one of them).
Unfortunately, I don't have a proper way to work around it in CopyQ itself - only using custom commands.
Hello. Hope all is well.
I'm curious if the following will resolve the issue or not. I didn't try this out, yet: "I use the following command to avoid this problem (here is how to add the command to CopyQ):"
I have to resolve this problem. It's already existent. Doesn't look as easy as taking candy from a kid!