Bug 489882

Summary: Konsole leaves behind old characters in text/html clipboard
Product: [Applications] konsole Reporter: Thomas Lindroth <thomas.lindroth>
Component: copy-pasteAssignee: Konsole Developer <konsole-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 23.08.5   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Thomas Lindroth 2024-07-07 15:31:43 UTC
If I select the text "1234" in Konsole and run "xclip -out -target text/html" I get the following output:
<span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">1234</span><br></span>

That is correct, but if I now select a single double-width character such as the Japanese character "私" and run xclip again I get this:
<span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">私2</span><br></span>

The number "2" now appears after "私". This number is left behind from the previous clipboard entry because Konsole gets confused about the length of the clipboard when it contains double-width characters.

I am running Konsole 23.08.5 with Qt 5.15.14 on X11 Linux.