Support Shift+click to select a range#636
Conversation
When a start anchor selected, which may be by a plain click (char mode), a double click (word mode) or a triple click (line mode), another Shift+click extends the selection from the start anchor to the clicked position, which may be further extended in word and line mode. This range selection behavior is seen in most common terminals, including at least Konsole and VTE-based ones. This patch is derived from an old version of Konsole, see commits: - Implement Shift+click to extend selection KDE/konsole@9a3d588 - Fix 'extend Selection' bug for apps not interested in mouse KDE/konsole@e5b7480 While there, moved two comments to the right place. Issue: lxqt/qterminal#818 Assisted-by: Claude Sonnet 4.6 (https://claude.ai/)
|
Thank you very much for your PR! Sadly, it covers only the visible part of the text when the start of the selection is below its end. |
You're welcome.
No. I opened another PR (#637) to address the scrolling/invisible screen issues, which happens to all other selection modes. |
Oh, thanks! It'll need a thorough code review and test, as it's about a sensitive part of the code which may affect other parts unexpectedly. Fortunately there's enough time until the next release. So, please be patient and test them in various scenarios that may be related to text selection in any way (e.g., highlighting of found matches, URLs, …). |
|
BTW, I also started to use both PRs until I find time for a code review. So far so good. |
Yeah, that PR touches some important logics, so a thorough code review is a must, and I'm very grateful. However, most of the changes are ported from Konsole, with a very minor part assisted by the AI, so I have some confidence in the PR, although I'm a newbie to GUI and Qt programming :) I also started using the patched qtermwidget on my working laptop, and so far so good. Thank you for taking care of my PRs. |
|
Keep up the good work! qterminal/qtermwidget needs contributors like you. |
When a start anchor selected, which may be by a plain click (char mode), a double click (word mode) or a triple click (line mode), another Shift+click extends the selection from the start anchor to the clicked position, which may be further extended in word and line mode. This range selection behavior is seen in most common terminals, including at least Konsole and VTE-based ones.
This patch is derived from an old version of Konsole, see commits:
While there, moved two comments to the right place.
Issue: lxqt/qterminal#818
Assisted-by: Claude Sonnet 4.6 (https://claude.ai/)