SUMMARY Somewhere between Konsole 18.04.3 in Kubuntu 18.10 and 18.12.3 in Kubuntu 19.04, selecting text with mouse in Midnight Commander running in Konsole or Yakuake became sticky. This is super annoying. STEPS TO REPRODUCE 1. Start Konsole, run "mc". 2. In Midnight Commander, open a text file and start typing. 3. Select a piece of text by pressing Shift, Left mouse button and moving the mouse. Notice that selection is adjusted by character, you can start and end selection in the middle of a word. 4. Select a word in the text by pressing Shift and double-clicking Left mouse button on the word. The whole word is selected. 5. Try again to select a piece of text, like in step 3. OBSERVED RESULT In step 5, moving the mouse selects text by words, not by characters. You can try starting the selection multiple times, every time it will select text by words. It is not possible to restore the original behavior of selection by characters, except by Left clicking somewhere in the text. EXPECTED RESULT 1. Shift + Left click should always start selection by character. 2. Shift + Double left click should always start selection by words. The two rules should be true no matter what kind of selection had been done before. SOFTWARE/OS VERSIONS Linux: Kubuntu 19.04 KDE Plasma Version: 5.15.4 KDE Frameworks Version: 5.56.0 Qt Version: 5.12.2
Is this issue only visible in "mc" or also in other terminal applications, such as text editors?
Technically, this is reproducible in both mc and mcedit (i.e. the file manager itself and the editor). I can't reproduce it in bare console or nano. I suspect this might be related to the fact that those don't handle mouse events and I don't have to hold Shift while selecting text. I can reproduce it with htop, which does handle mouse events.
Also happens in tmux. Konsole 18.12.3.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/655
Git commit e4cbfef2b5a18337b6ae787db2cc253df721e7e6 by Tomaz Canabrava, on behalf of Luis Javier Merino Morán. Committed on 23/05/2022 at 10:50. Pushed by tcanabrava into branch 'master'. Allow ending wordwise select in mousetracking mode Commit e2167eb0 restricted deactivating the word-wise/line-wise selection mode to mouse presses with no modifiers. Since in mouse-tracking mode, the Shift key has to be pressed to not pass mouse events to the application running on the terminal, there was no way to end word-wise/line-wise selection mode without sending a mouse event to the application. Modify the logic so ending word-wise/line-wise selection mode is done by a LMB button press with no modifiers on non-mousetracking mode, and by a LMB button press with only the Shift modifier on mousetracking mode. M +1 -1 src/terminalDisplay/TerminalDisplay.cpp https://invent.kde.org/utilities/konsole/commit/e4cbfef2b5a18337b6ae787db2cc253df721e7e6