Summary: | Don't include trailing colons when selecting words via double-click | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Nate Graham <nate> |
Component: | font | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | egmont, ossi |
Priority: | NOR | Keywords: | usability |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/konsole/9ce051371dcf98ad14c2dffdf567fe01f0a369e5 | Version Fixed In: | 18.12.0 |
Sentry Crash Report: |
Description
Nate Graham
2018-10-01 19:13:14 UTC
You can configure it under the profile's setting -> Mouse tab. In gnome-terminal, colon is not included in the set by default, for reasons similar to your preference. We keep getting asked to add it, so that URLs can be selected by a double click (although our URL autodetection, just like konsole's, uses a much more fine grained algorithm than a set of word characters, e.g. excludes the trailing dot, so the result would still be far from perfect). Colon is by far the most debated character whether should be included or not by default. Thanks! I can see the argument for consistency with GNOME Terminal, but I'd rather not wade into that debate right now. Regardless of whether or not a colon is added to that list, I'm saying that a colon on the very end, with nothing but whitespace after it, should never be considered part of a URL for autodetection purposes. We don't need to add it to that list to implement the proposal and fix this issue. It may even result in reduced user pressure for adding a colon to the list. :) Don't get me wrong, I didn't mean to pressure you to sync with gnome-terminal :) Do whatever you prefer. I just added a data point that you might find useful.
BTW I'm not sure why you're talking about URLs, it's a bit misleading. Your use case is just words (it's even irrelevant now that they are local filenames) ending in colons, nothing like file:// or http:// in the game.
> I'm saying that a colon on the very end, with nothing but whitespace after
> it, should never be considered part of a URL for autodetection purposes.
Having a user-configurable set, plus an actual behavior that contains further hacks and doesn't fully respect what the user configured, would in my opinion be pretty confusing. But again, it's KDE's choice, I'm just stating my opinion.
Well anyway, here's a patch: https://phabricator.kde.org/D16578 Let's see what Kurt thinks. Git commit 9ce051371dcf98ad14c2dffdf567fe01f0a369e5 by Kurt Hindenburg, on behalf of Nate Graham. Committed on 02/11/2018 at 13:51. Pushed by hindenburg into branch 'master'. Don't consider a colon before whitespace to be part of a word Summary: Currently, colons are considered to be part of words for the purpose of double-click selection. This allows, for example, URLs to be selected with a double click. This is good. However, including colons works less well for paths that end with a colon and whitespace--such as `grep` output. Removing the colon from the list of word characters isn't a great solutionsince then URLs can no longer be selected by double-clicking. This patch resolves that particular issue by always omitting a colon from double-click selection when it's immediately followed by whitespace. FIXED-IN: 18.12.0 Test Plan: `grep -ri charClass .` Then double-click on one of the paths in the output. The trailing colon is not included in the selection. Reviewers: #konsole, hindenburg Reviewed By: #konsole, hindenburg Subscribers: konsole-devel Tags: #konsole Differential Revision: https://phabricator.kde.org/D16578 M +6 -2 src/TerminalDisplay.cpp https://commits.kde.org/konsole/9ce051371dcf98ad14c2dffdf567fe01f0a369e5 hard-coding the exception is a rather questionable solution. a fully generic solution would be a configurable regular expression. however, that might be considered too complex for regular users, and not necessarily very useful to start with. a less complex solution would be having an additional character class: mid-word characters. these would be considered part of the word only if surrounded by regular word characters. apart from the colon, the period would be included here as well. |