! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Option to disable middle-click-opens-URL
Status:
RESOLVED: DUPLICATE
Severity:
enhancement
Product:
Xfce4-terminal
Component:
General

Comments

Description David M. Lloyd 2012-07-27 19:25:15 CEST
Old school folks like myself assume that middle click always pastes.  But if you happen to be moused over text which looks like a URL, instead of pasting it pops open the URL, which (for me) has never been desired behavior any time it has happened (I always right-click and choose "Open URL").  I then have to hunt down some part of the screen which isn't covered by URLs which can be tricky when using certain build tools.

It would be nice if this behavior could be switched off in the Preferences dialog.
Comment 1 Mike Massonnet editbugs 2012-07-31 23:22:48 CEST
Hi David,

There is a hidden option for this: MiscHighlightUrls=FALSE
http://docs.xfce.org/apps/terminal/advanced

Note that this will also disable right click on a link to open it.

Regards,
Mike
Comment 2 David M. Lloyd 2012-08-01 20:54:54 CEST
Why can there not be an option to disable this middle-click action while still allowing right-click to work?
Comment 3 Mike Massonnet editbugs 2012-08-01 22:40:14 CEST
If you think it should be enhanced, feel free to reopen the bug ;)
Comment 4 David M. Lloyd 2012-08-28 18:46:14 CEST
OK.  I'd like to request a way to configure the terminal so that middle-click always pastes, but right-clicking on URLs still brings up the menu.

Thanks.
Comment 5 Adam Borowski 2013-06-24 13:13:38 CEST
Created attachment 5078 
a destructive patch that works for me

The current misfeature is pretty infuriating, especially when you, say, go through "git log" to grab commit hashes to cherry-pick.  There will be a lot of email addresses on the screen...

On the other hand, being able to right-click on an URL is pretty useful.  There's no point in having both right and middle-click do the same, though, especially that middle-click doesn't take context anywhere else.

The attached patch disables middle but not right click, it has been working fine for me for ages.  You'd want to replace #if 0 with a hidden setting, of course.

I think it might be better to make middle click consistent by default (ie, either always a contextful or context-free action), but I'm probably biased.  Having this as a hidden setting instead of having to patch would be nice.
Comment 6 Adam Borowski 2013-12-04 18:58:44 CET
Repeatedly patching + rebuilding gets boring, so what should I do to get this accepted upstream?

I see three ways:
1. a hidden option
2. an official in-UI option
3. just always doing it The Right Way™
Please choose.
Comment 7 David M. Lloyd 2013-12-04 19:34:14 CET
I like option #3 myself - middle-clicking to open URLs is just plain weird.
Comment 8 Jarno Suni 2014-01-13 10:11:58 CET
Middle click should always paste by default. If somebody wants to have a setting to change that behavior, he/she should request/implement it.
Comment 9 unhammer+dill 2014-02-06 08:45:46 CET
(In reply to David M. Lloyd from comment #7)
> I like option #3 myself - middle-clicking to open URLs is just plain weird.

The combination is also dangerous. 

I've unfortunately gotten used to middle-clicking to open urls (it opens in new tab in Firefox), but if I miss the url by a pixel I end up pasting whatever the selection is. I'm afraid I'll paste sensitive information in an IRC chat or dangerous commands into the terminal.

Other terminals use ctrl+click to open urls quickly, I would prefer that: https://bugzilla.xfce.org/show_bug.cgi?id=10621
Comment 10 Adam Borowski 2014-02-06 22:25:48 CET
The only potential reason I see to use MClick when you can RClick + move the mouse 1 px down + LClick (it's the #1 item on the pop-up menu) is when you'd want to open a bunch of URLs as browser tabs in a quick succession.  unhammer's idea would serve that use case just as well.

What would you guys think?  Moving this functionality to Ctrl-LClick sounds good to me.

An untested patch: in terminal_widget_button_press_event():
- if (event->button == 2 && event->type == GDK_BUTTON_PRESS)
+ if (event->button == 1 && event->type == GDK_BUTTON_PRESS
+     && event->state & GDK_MODIFIER_MASK == GDK_CONTROL_MASK)
Comment 11 Tianon Gravi 2014-02-06 22:33:32 CET
+1, the middle click drives me nuts (I try middle click pasting real fast into a terminal and a browser window opens up all too often because I happened to hit a link) and Ctrl+Click sounds like a great compromise to me
Comment 12 Tianon Gravi 2014-02-06 22:34:13 CET
Sorry for the double post, but just realized that this would then be overlapping with "block selecting", so maybe Ctrl+Middle?
Comment 13 Andre Miranda editbugs 2014-04-04 03:50:28 CEST
(In reply to Tianon Gravi from comment #12)
> Sorry for the double post, but just realized that this would then be
> overlapping with "block selecting", so maybe Ctrl+Middle?

Related: bug 10621
+1 for ctrl+click
Comment 14 Tatu Kilappa 2015-09-15 20:42:36 CEST
Created attachment 6458 
[PATCH] Add option to use either middle-click or control-click to open URIs

Patch adds option "MiddleClickOpenUri" that, if set (default: yes) works as currently. If not set, uses ctrl-click to open URIs instead.
Comment 15 Tatu Kilappa 2015-09-15 20:45:43 CEST
A compromise is better.

Also added the same patch to that another bug that kind of asks the same thing:
https://bugzilla.xfce.org/show_bug.cgi?id=10621
Comment 16 Igor editbugs 2016-07-27 11:10:26 CEST
The patch has been merged, marking as duplicate.

*** This bug has been marked as a duplicate of bug 10621 ***

Bug #9166

Reported by:
David M. Lloyd
Reported on: 2012-07-27
Last modified on: 2016-07-27

People

CC List:
10 users

Version

Attachments

Additional information