I have opened a Windows link file (.lnk) in Kate to copy command line parameters out of it (seemed easier than to research anew information that already lies on my disk). Unfortunately, the text isn’t copied to the clipboard. Kate, somehow, still “knows” it has been copied so I can paste it in the same or other documents in Kate itself, but nowhere else. I could observe the same behaviour in KWrite.
Upon further testing, it seems I can copy some text, but I’m not sure how that is determined. Text from the first full path seems fine (even tested other .lnk files), second full path not. I’d understand if the mangled characters in between (due to not being supposed to be characters at all) couldn’t be copied, but it even happens with actual text.
When trying to copy everything (ctrl+a, ctrl+c), only the first character (“L”) is copied to the clipboard, everything else is cut off. Hitting ctrl+v in another document of the same program (i.e. Kate), everything is pasted, not only the first character.
At other times, a failed copy doesn’t modify the clipboard at all.
Considering copying seems to work fine within an application (like Kate and KWrite), I don’t see a reason it shouldn’t work into the system clipboard and other programs.
If I open a terminal and type “cat file.lnk” then I can copy all the text, including paths and parameters, without issue. I would prefer using a text editor, though - copying from terminal is still a bit unfamiliar.
Is it a bug? Is it a feature? How can I copy text from arbitrary files into other programs? This won’t be the first time I might need to copy text from a seemingly binary file.