Bug 170871 - Make 'close tab on middle click' an option or disable it completely
Summary: Make 'close tab on middle click' an option or disable it completely
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 161151 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-09-11 19:37 UTC by Richard Hartmann
Modified: 2009-02-23 19:55 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Hartmann 2008-09-11 19:37:09 UTC
Version:           2.1 (using 4.1.1 (KDE 4.1.1), Debian packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.26-1-686

Short desc says it all. I just clicked the tab rather than the shell by accident. Instead of pasting, I closed the tab. Annoying, that.
Comment 1 Richard Hartmann 2008-09-11 19:40:32 UTC
Related to: http://bugs.kde.org/show_bug.cgi?id=167869
Comment 2 Will Stephenson 2008-09-12 12:08:22 UTC
*** Bug 161151 has been marked as a duplicate of this bug. ***
Comment 3 Will Stephenson 2008-09-12 12:13:49 UTC
Permit me to make this a bug, not a wishlist - no other tabbed app has MMB close, it's a unconfirmed destructive action, and it's a behaviour change to KDE 3's konsole.
Comment 4 David Faure 2008-09-18 17:25:32 UTC
Yep, this is really bad. I very often pressed the MMB without noticing the mouse was over a tab. IMHO MMB on tab should paste the selection into the tab's terminal, just like pasting would do if the mouse was a bit higher up.
There are plenty of ways to close tabs already... Ctrl+D being the faster way.
Comment 5 Robert Knight 2008-09-18 18:15:10 UTC
> Permit me to make this a bug, not a wishlist - no other tabbed app has MMB close

Firefox does and I'm guessing that is the tabbed application which people use most.  Meanwhile Konqueror also has this but as an option and I'd really rather not require the user to configure this behavior in each application - if we do make this flexible and I'd suggest that we don't.  

> and it's a behaviour change to KDE 3's konsole. 

You're right - but I felt that it was better to have consistency across current applications.  For me that means Firefox.  
Comment 6 Robert Knight 2008-09-18 18:16:26 UTC
To clarify my above comment - if someone adds a setting to make this a KDE-wide setting I will modify Konsole to respect it but I don't think it is a good idea to duplicate a whole bunch of tabs settings in every application.
Comment 7 David Faure 2008-09-18 18:26:00 UTC
But pasting into konsole (even near the tabbar) is MUCH more common than pasting into firefox/konqueror (near the tabbar). The usability problem doesn't happen in web browsers, you usually only paste into form widgets, which are rarely near the tabbar.

Anyway, if this doesn't convince you, then let's go for a KDE-wide settings indeed -- but I would make it OFF by default, this is an advanced-users feature, my wife would go mad if she did MMB by accident on a konqueror tab.
The problem with a kde-wide setting is that it becomes non-obvious where to actually set the setting (but if it's off by default, then advanced users can probably find it ;)
Comment 8 Richard Hartmann 2008-09-18 19:25:20 UTC
I don't have KDE 4 on this box, but Konqui 3.5.10 tries to access whatever is in the X paste buffer when you press MMB on a tab. I don't think it is a good idea to default to something Firefox, a third-party GTK application, does. If anything, it should be in sync with Konqui 4.1.x.

Not much more to add as dfaure said everything I could have said :)
Comment 9 Matthew Woehlke 2008-09-18 19:40:59 UTC
Besides what dfaure said, there's a difference in web browsers, because accidentally losing a tab is less likely to cause lost work (especially since FF has recently closed tabs; effectively, there is an 'undo' if you close a tab by accident). Accidentally closing a tab in konsole can cause irretrievable data loss.
Comment 10 Richard Hartmann 2008-09-18 19:54:49 UTC
Browser tabs closing 'magically' can cause data loss, as well. I can't see much difference, there.

The main issue I see here is that, usually, MMB on X means 'I want to access information' whereas in the Windows world, there is no such correlation. If there were such a thing, I am certain FF would never have used MMB for 'I want to destroy information'.
Comment 11 Robert Knight 2008-09-18 19:55:20 UTC
> I don't think it is a good idea to default to something Firefox,
> a third-party GTK application,

It doesn't matter what toolkit the application is written in.  What matters is that its free software, its popular, I like the project's goals and attitude and the same people who use it also use my software.  

Having said that, I agree with David's point about pasting text into a tab not being potentially useful in a web browser.
Comment 12 Matthew Woehlke 2008-09-18 20:26:07 UTC
> Browser tabs closing 'magically' can cause data loss, as well. I can't see
> much difference, there. 

True, but I've lost data in 'magically closed' konsole tabs much more often than I've accidentally closed browser tabs with unsaved form data. (There isn't data loss on simple web pages, at least not with FF, because you can simply re-open the tab. For that matter, I can even see loss of form data being considered a bug.)

I also can't say I've "accidentally" closed a browser tab (meaning, I didn't intend to close it, as opposed to intentionally closing it and immediately deciding I shouldn't have done that :-)). I've accidentally closed konsole tabs, when trying to paste, on a number of occasions. (IOW I agree with dfaure that you're more likely to mis-click in konsole than in a browser. Especially since konsole provides 90+% of the screen as a target, such that one does not need to aim nearly so carefully... or wouldn't, if not for needing to carefully aim AWAY from the tab bar.)
Comment 13 Robert Knight 2008-09-22 00:58:57 UTC
Bug report where feature was originally requested - http://bugs.kde.org/show_bug.cgi?id=137938
Comment 14 Will Stephenson 2008-09-22 10:18:04 UTC
Please, make that feature configurable and default to off then
Comment 15 Richard Hartmann 2008-09-22 10:40:47 UTC
After reading 137938, I just checked the behavior of Konqueror 4.1.1. In vanilla mode, MMB on tab will try to use the X buffer's content as an URI. I could not find an option to change it to close on MMB, at least as of 2006-11-26, you had to add this manually. I did not look too deeply though, so it might be a GUI-accessible option, these days.
Comment 16 David Faure 2008-10-09 18:51:37 UTC
Fixed by Robert Knight in r863326 - thanks!
Comment 17 Tobias 2009-02-23 16:07:43 UTC
So what is the solution now? It seems that in trunk (and also in KDE 4.2) there is now a way to open a tab with the mouse (double click on tab bar) but no way to close it with the mouse again (no close button, no context menu). This is surely annoying. 

Dolphin also has tab close on middle click in trunk now, Firefox has it, Konqueror can be configured to have it... maybe this should really be a system wide setting. For me it just makes no sense to middle click on a tab to paste. Why would you even middle click near the tab bar to paste when you can click anywhere in the window? Maybe there could be a warning dialog with an option to "not show this warning again". But the current behavior is very unsatisfactory. If there is a way to open a tab with the mouse, there has to be a way to close it with the mouse, as well.

My first choice would really be a system wide setting (I'd also like to middle click to close tabs in Akregator, e.g.) but if this is not an option, make it a Konsole setting or at least bring back the KDE3 behavior (with open and close buttons)

Thank you
Comment 18 Robert Knight 2009-02-23 17:01:57 UTC
> least bring back the KDE3 behavior (with open and close buttons)

There is an option for that in Settings -> Edit Current Profile -> Tabs
Comment 19 Richard Hartmann 2009-02-23 18:01:09 UTC
Last time I clicked the tab with MMB by mistake, I was asked if I wanted to close it while an application was running. It closed without confirmation dialogue when no application was running under the top-level shell. No idea when that was, though.

On the risk of beating a somewhat dead horse, there is one massive difference between browsers and terminals: People do not need to care about cursor placement when pasting into a shell program (at least when X mouse detection is off in Vim and the like, which is the usual case for me and pretty much everybody I know IRL) whereas you need the mouse pretty much all the time while browsing (if you discount vimperator, etc).
Comment 20 Tobias 2009-02-23 18:35:13 UTC
@Robert: So middle click won't come back even as a setting? This is really sad! However, I think the new tab and close tab buttons should be on by default because it is unlikely that many people will find this setting and without it there is no easy way to close tabs anymore! If you don't want to clutter the space you could provide close buttons on the tabs which I'd actually prefer!

@Richard: I understand but if you had known that middle click on tab closes it, it wouldn't have been a problem to middle click anywhere else, would it? So MY ideal solution would have been to enable it by default and bring up a warning dialog the first time with the option to disable it. But I accept that Robert wants to keep things simple and I respect his decision even though I find it sad that close on middle click is not even an option anymore.
Comment 21 Richard Hartmann 2009-02-23 18:46:40 UTC
> I understand but if you had known that middle click on tab closes it,
> it wouldn't have been a problem to middle click anywhere else, would it?

Well, the very definition of 'by accident' is that you did not do it on purpose ;)
Comment 22 Tobias 2009-02-23 19:55:04 UTC
Well, but since you have the whole window to click to paste. it shouldn't be a problem to pick a space far enough from the tab bar... otherwise you could also close the window by accident when trying to move it because you hit the close button :)

But whatever, I'm completely ok with this being disabled by default. I'd just like to have an option to enable it again, if possible. But I already joined in on the discussion at https://bugs.kde.org/show_bug.cgi?id=170004 to make this global. So I guess we should just stop here.