If you want an apple, as for an apple. If you want a pear, ask for a
pear. What you do is you want a pear, yet you ask for an apple and
expect to receive the kind of apple that tastes as close to pear as
possible. And even though you can configure the kind of the apple you'll
receive, it's still not good enough for you, you wish that Ubuntu by
default configures to deliver your favorite kind of apple, the one that
tastes the closest to pears. You keep ignoring that you could actually
ask for a pear if that's what you want, or that the default kind of
apple was decided by those who actually want an apple apple, not a pear-
ish apple.

(In case it's not clear: apple = select a word; kind of apple = the
configured characters that should be considered part of a word; pear =
select a URL.)

> > Double clicking, by design, is _not_ meant to select URLs.

> Really? Which design is that?

I've checked the behavior of the following apps for you: Terminal
emulators: Linux console + gpm, xterm, urxvt, konsole, st, pterm,
terminology, mlterm; browsers: Firefox, Chrome and Opera, and in each of
them a non-hyperlinked URL as part of a rendered page, a simple
textarea, as well as Gmail's compose window; other apps: LibreOffice
Writer (hyperlink removed), gedit.

Guess what: Out of these urxvt is the only one that selects URLs on
double click. Plus xterm and konsole are the ones that work as gnome-
terminal used to work (including the bugs you're aware of: due to only
looking at the characters individually, quite often they don't correctly
recognize URLs because they simply don't care about URLs when you double
click). All the other apps select a shorter segment of the URL.

So you ask what design it is... well, it is the design of most of the
apps out there.

You're perfectly aware that what gnome-terminal used to do was far from
perfect, it made mistakes many times. Example: Let's take a URL with a
trailing dot, such as this sentence: "For details see
http://example.com/whatever.html."; Hover underlining does exclude the
trailing dot, and similarly the right-click menu's Open/Copy Link
actions exclude it too. It was never possible to do the same with double
clicking. Either the dot character is included in the set of word
characters, in which case the trailing dot is included, or it is
excluded from the set, in which case double clicking also stops the
selection at the middle of the domain name, or before the extension.

Apart from urxvt, I don't think any terminal emulators implement a more
sophisticated algorithm for double clicking, and with their current
approach (looking at characters individually) it is just not possible to
make it right.

gnome-terminal/vte has never implemented anything more sophisticated
either, and has no such bug entry and I can't recall any TODO about it
either. If it was ever agreed that double clicking should recognize and
highlight URLs, I'm absolutely certain there would be a bug entry about
it, or it would already be implemented. This is a clear proof that
double clicking was never meant to select URLs. This is not my personal
opinion, this is a fact. Double clicking is meant to aid conveniently
select logical parts of any regular text (not URLs), such as the output
of a grep, gcc, whatever command.

> And regardless of whether or not double click is meant to select URLs,
> it's a literal fact that it did in fact (largely) select URLs for many
> years.

The key is "largely" here.

In previous gnome-terminal versions double clicking on a URL selected it
properly with a perhaps (wild guess) let's say 90% accuracy. Is this a
reasonable guess? (The trailing dot discrepancy mentioned above is just
one of the many cases where double clicking's plain stupid algorithm
gave different result than the complex URL regex.)

Myself being a software engineer (actually a recent active contributor
to gnome-terminal/vte), you're never going to get my buy-in for
something that works 90% of the time. Never. I'm not going to approve
something that "largely" works. I might approve something that "always"
works, or with an as small error rate as inevitable.

Adding back ":" to wordchars is the "workaround" of the best
gain:investment ratio that you could do now on your computer (1 minute
investment, gain is that it works ~90% of the cases for you), but is
definitely not a solution suitable for mainstream.

And let's not forget that while adding ":" would sorta-kinda but not
fully solve your problem, it would break the workflow of many other
people (who actually use double click for what it was designed for).

I cannot understand why you ask for making it work about 90% of the
time, for bringing back that broken implementation, and I really don't
feel like continuing the discussion in this direction.

What I would understand (I probably still wouldn't agree with you, but
it would make sense to have a nice discussion) is if you asked for URLs
to be highlighted on double-click exactly as they are already recognized
as URLs right now when underlined on hover, or accessed via the right-
click menu (e.g., with the above example, excluding the trailing dot).
This could be achieved by some coding (as done in urxvt), but not by
fiddling with wordchars.

> That's your opinion; in my opinion this is a regression in Ubuntu.

Anything that's not an obvious bugfix is always controversial, there are
always people who dislike any such change. This on its own is not a
reason to revert such changes. In this case something that (i) was never
intended to work, and (ii) never actually worked reliably, that is,
obviously it was a mere coincidence that it often worked, no longer
works in the default config. Whereas, in turn, for some other folks
something else (something that was a design goal, e.g. selecting the
filename from grep's output, or tons of similar ones) is much more
convenient now.

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gnome-terminal in Ubuntu.
https://bugs.launchpad.net/bugs/1501250

Title:
  double clicking on a URL drops the protocol from the URL

To manage notifications about this bug go to:
https://bugs.launchpad.net/vte/+bug/1501250/+subscriptions

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to