Bug 474055 - Partial selection of double width characters
Summary: Partial selection of double width characters
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 23.08.0
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-02 13:22 UTC by Grigory
Modified: 2023-11-14 00:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: v23.08.3
Sentry Crash Report:


Attachments
Video demonstration (2.58 MB, video/mp4)
2023-09-02 13:22 UTC, Grigory
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Grigory 2023-09-02 13:22:52 UTC
Created attachment 161342 [details]
Video demonstration

SUMMARY

When selecting double width characters, there's a possibility to select "nothing" which may contain invisible control characters. Reproduced it in both 23.04.2 and 23.08.0 versions of Konsole.

STEPS TO REPRODUCE
1. Run Konsole
2. Insert some double width characters
3. Try to select them starting from about the middle of the character

OBSERVED RESULT

Double character is selected partially (see attached video)

EXPECTED RESULT

Double character must be selected completely

SOFTWARE/OS VERSIONS

Konsole: 23.04.2 (from repos), 23.08.0 (from flathub)
Window compositor: Sway 1.8.1
OS: Void Linux (up-to-date)

ADDITIONAL INFORMATION

See attached video for demonstration
Comment 1 Bug Janitor Service 2023-09-23 00:52:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/897
Comment 2 Kurt Hindenburg 2023-10-04 13:50:15 UTC
Git commit 8fc924849a592c410f2fb519fe6ccbaedb55517b by Kurt Hindenburg, on behalf of Luis Javier Merino Morán.
Committed on 04/10/2023 at 15:45.
Pushed by hindenburg into branch 'master'.

Don't select half a CJK character

This was a visual regression.  Code using the selection already takes
care of dealing with CJK wide characters (mostly), and the old rendering
in TerminalPainter also did.  The new rendering is split in several
layers, which need to know about the selection to use the proper
background and foreground colors, but don't necessarily need to know
about characters, and this caused the regression.

To prevent trouble, we now take care of CJK wide characters before
rendering, when obtaining the characters from the model (Screen), where
characters are marked as selected if they fall into the selection
coordinates.

M  +21   -4    src/Screen.cpp
M  +0    -6    src/terminalDisplay/TerminalPainter.cpp

https://invent.kde.org/utilities/konsole/-/commit/8fc924849a592c410f2fb519fe6ccbaedb55517b