After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786935 - Support copying URLs without using right-click menu
Support copying URLs without using right-click menu
Status: RESOLVED OBSOLETE
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-28 18:37 UTC by Peter Boström
Modified: 2021-06-10 21:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (4.22 KB, patch)
2017-08-28 19:43 UTC, Egmont Koblinger
none Details | Review

Description Peter Boström 2017-08-28 18:37:28 UTC
Earlier versions of gnome-terminal used to select most URLs (including protocol) by double-clicking parts of URL (not always, not perfect, etc.) even though it never was intended to select full URLs. This could be used with ctrl+shift+c to copy the URL quickly (a lot faster than right-click menu for me).

This "regression" got filed in Ubuntu here: https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1501250

Ctrl+click, which will open the URL in the browser, could be used as a workaround in some cases. Howver, this requires going to the browser workspace, ctrl+l (location bar), ctrl+c to copy the link. If the link you're selecting is a download link it doesn't work at all since you'd have to esc out of saving location, which closes the tab (in Chromium), so you can't get to the link from the browser at all.

Egmont suggested I filed an upstream bug to get the maintainer's opinion: https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1501250/comments/15

Long story short, is it feasible to add ctrl+shift+click as a shortlink to copy the URL to the clipboard? I would be very happy with that as a solution since it doesn't require me using the right-click menu or abusing double-clicking words as URL selection.
Comment 1 Peter Boström 2017-08-28 19:30:50 UTC
FWIW I think the feature would be discoverable if "Copy Link Address" in the right-click menu would show (Shift+Ctrl+<click>) next to it, though that does make the menu wider overall.
Comment 2 Egmont Koblinger 2017-08-28 19:43:11 UTC
Created attachment 358629 [details] [review]
Fix

Here's the first version.

I'm not sure whether to copy to the clipboard or the primary selection, but since you mentioned Ctrl+Shift+C as part of your workflow, I went with the clipboard.

Also unsure about the grab_focus() call (or lack thereof) copied from the match_clicked_cb method.

match_clicked should be renamed to match_open.
Comment 3 Peter Boström 2017-08-28 20:06:17 UTC
I think this being a shortcut for the existing "Copy Link Address" is sensible unless you want another branch in behavior. If they're equivalent you can put Shift+Ctrl+<click> next to the right-click menu entry for discoverability.

This definitely matches my workflow, so I'm happy, but I've never really used primary selection, so I can't tell whether it makes sense over the other option. Maybe that's another way to see the downstream-reported "regression", that there's no good way to copy to primary selection if you can't easily select URLs.
Comment 4 John W 2021-01-26 22:03:17 UTC
I believe a case could be made that double clicking should not select punctuation at the end of a "word", but it *should* select it at the beginning of a word.  Therefore, if ":" and "/" (and others) are in the set of "word characters", double clicking a URL will work properly and so will selecting a filepath.  Also, double clicking a grep output name (ending with ":") will not select the colon.  This seems to be to be a nice compromise.

I agree with the sentiment that the right click menu is cumbersome.  Double clicking is so much handier.  The menu is for exceptional cases, not everyday cases and double clicking a URL or a filepath is a many, many times a day occurrance for many of us.
Comment 5 GNOME Infrastructure Team 2021-06-10 21:17:35 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/7764.