Bug 448144 - regression: copying using ctrl_shift_c no longer works
Summary: regression: copying using ctrl_shift_c no longer works
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-09 03:43 UTC by Chiitoo
Modified: 2022-01-11 15:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chiitoo 2022-01-09 03:43:54 UTC
STEPS TO REPRODUCE
1. Launch Konsole and try to select and copy only one character using 'ctrl_shift_c'.

OBSERVED RESULT
^C is sent instead of copying the character.

EXPECTED RESULT
The character selected is copied.

SOFTWARE/OS VERSIONS
Linux: Gentoo Linux
KDE Plasma Version: git master
KDE Frameworks Version: git master
Qt Version: 5.15.2 (KDE) git master

ADDITIONAL INFORMATION
Not a full KDE Plasma install, but just enough to use KWin with LXQt.

This starts with commit 5919c1fd0a2 [1].

1. https://invent.kde.org/utilities/konsole/-/commit/5919c1fd0a2e174079055b747aa279209900c6c6
Comment 1 Yerrey Dev 2022-01-09 16:03:45 UTC
src/Screen.cpp:1428 isSelectionEmpty() returns true with a selection of 1 character as _selTopLeft equals _selBottomRight. This causes the program to think there is no selection. I don't know the Konsole code well enough, but I don't see why isSelectionEmpty() can't be just replaced with hasSelection() as with my compile that seems to fix this problem (I don't know if there can be a valid selection that is empty).
Comment 2 Bug Janitor Service 2022-01-10 00:18:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/574
Comment 3 Kurt Hindenburg 2022-01-11 15:51:51 UTC
Git commit 830f416850911ec4f0104635fee9fb8f832c1dcc by Kurt Hindenburg, on behalf of Luis Javier Merino Morán.
Committed on 11/01/2022 at 15:44.
Pushed by hindenburg into branch 'master'.

Fix copying one single char

Regression introduced by 5919c1fd.  The selection range is inclusive in
both ends.

Thanks to Chiitoo for reporting and to Yerrey Dev for proposing a
solution.

M  +1    -1    src/Emulation.cpp
M  +0    -9    src/Screen.cpp
M  +0    -1    src/Screen.h

https://invent.kde.org/utilities/konsole/commit/830f416850911ec4f0104635fee9fb8f832c1dcc