Bug 167869 - tabs can be closed without confirmation
Summary: tabs can be closed without confirmation
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Robert Knight
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-31 17:59 UTC by Matthias Kretz
Modified: 2008-09-22 11:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
proposed patch (1.63 KB, patch)
2008-07-31 18:06 UTC, Matthias Kretz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Kretz 2008-07-31 17:59:47 UTC
Version:            (using Devel)
Installed from:    Compiled sources

Per default the shortcut 'Ctrl+Shift+W' is assigned to 'Close Current Tab'. The action is performed without confirmation. As a vim user that presses Ctrl+W rather often I sometimes accidentally hit Ctrl+Shift+W and my tab is gone - with whatever work I was doing at the moment.

Suggestions:
a) show dialog asking for confirmation, defaulting to cancel, to avoid an accidental Ctrl+Shift+W Return
b) remove the shortcut from the default shortcuts
Comment 1 Matthias Kretz 2008-07-31 18:01:07 UTC
setting severity to "grave" because it's used for "loss of data"
Comment 2 Matthias Kretz 2008-07-31 18:06:48 UTC
Created attachment 26532 [details]
proposed patch

removes all (potentially) destructive default shortcuts
Comment 3 Matthew Woehlke 2008-07-31 18:16:51 UTC
Please add confirmation when closing a tab, either by ctrl-shift-W (or other shortcut) or *middle clicking on it*. The latter is MUCH too easy to do by accident when intending to paste into the pty instead.

An option to not ask ("do not ask again" maybe?) is fine, but the default should be noisy-but-safe, not quiet-but-dangerous.

(Matthias: please excuse me hijacking your bug ;-).)
Comment 4 Robert Knight 2008-08-01 00:36:08 UTC
> setting severity to "grave" because it's used for "loss of data" 

Any number of things can cause data loss in a terminal.  It is and has been for a long time a completely unsafe environment.  Almost every keyboard shortcut in Konsole is probably 'destructive' in one application or another - probably many in applications I have never heard of or used (I am a heavy Vim user).  Ctrl+D, Ctrl+C are much more common examples.

This is the first time the bug has been reported to me (on bugs.kde.org) or anywhere - and I normally hear about this sort of thing very quickly - see the bugs and IRC chatter after I implemented close tabs on buttons.

I will:
- Set this bug to 'normal', because there are bugs which are bothering many more users.  Making the shell 'safe' frankly involves a lot more than changing two shortcuts.
- Provide a close warning when an application other than the shell is running in the terminal

Unless this bug report gets lots of dupes on people complaining to me on IRC or my blog I do not plan to change the default shortcuts.  They match (as close as possible) shortcuts used to manage tabs in other applications which is I think makes learning them easier.



Comment 5 Matthew Woehlke 2008-08-01 00:54:44 UTC
> Any number of things can cause data loss in a terminal.

True, but I'd like to at least avoid the ones that are Konsole's fault ;-).

I've never had a problem with ctrl-c/ctrl-d... I *have* gotten bit by the MMB click in just-barely the wrong spot (but hadn't reported it yet). For me, all I'm looking for here is confirmation *whenever* Konsole is "asked" to close a tab, not just if something other than $SHELL is running.

@Matthias: I'm voting for your suggestion a), which I'd like to see for MMB as opposed to the 'close tab' shortcut (and I'm hoping Robert is more amenable to that than changing the shortcut, which frankly isn't my first choice either). Would you also be OK with that?
Comment 6 Matthias Kretz 2008-08-01 01:45:47 UTC
On Friday 01 August 2008 00:36:10 Robert Knight wrote:
> This is the first time the bug has been reported to me (on bugs.kde.org) or
> anywhere - and I normally hear about this sort of thing very quickly - see
> the bugs and IRC chatter after I implemented close tabs on buttons.


The first two or three times I experienced it I was completely lost, not 
knowing what had just happened. Later I had the idea that it could have been a 
Konsole shortcut (though I had no idea which one, as I was in a fast 
succession of key combination presses every time it happened). I then set the 
key combinations in question to something crazy (because clearing it is 
impossible) but yesterday the problem reappeared again. The shortcut was reset 
- not 100% sure whether that was my doing - and this time I thought I'd better 
report it, before other people go crazy not knowing what happened to them as 
was the case for me or before it gets reset to the default again for me.

> I will:
> - Set this bug to 'normal', because there are bugs which are bothering many
> more users.  Making the shell 'safe' frankly involves a lot more than
> changing two shortcuts.


severity != priority
click on severity on the bugs.kde.org page to see a definition. I'm fine with 
whatever priority you'll give that bug, but I disagree that this is a normal 
bug, because I lost work a few times now (thanks to vim's frequent auto-save 
it has never been too bad).

> - Provide a close warning when an application other
> than the shell is running in the terminal


Alright, I agree that this should be added in any case.

> Unless this bug report gets lots of dupes on people complaining to me on
> IRC or my blog I do not plan to change the default shortcuts.  They match
> (as close as possible) shortcuts used to manage tabs in other applications
> which is I think makes learning them easier.


Of course I've seen the relation to Ctrl+W, but the question remains whether 
that shortcut is needed, and even if it might be useful to some people, 
whether it should be Ctrl+Shift+W per _default_.

My pattern to close a tab is to press Ctrl+D in the shell. That's enough for 
me and IMO there is no need for a shortcut to close a tab, because either it's 
running only the shell (then Ctrl+D is enough) or it's running an application 
(then you don't want to close the tab and shutdown the app forcibly, but quit 
the application normally). There's a third scenario: a hanging shell/app. But 
since that is an exception and nothing I'll memorize a keyboard shortcut for 
anyway, I'm fine with using the mouse to close the tab in that case (I'm using 
right click -> Close Tab).
Comment 7 Matthew Woehlke 2008-08-01 05:03:19 UTC
> > - Provide a close warning when an application other 
> > than the shell is running in the terminal 

*Always*, please. Just because I'm at a command prompt doesn't mean there is no way I will lose valuable data/work if I accidentally close the tab. The last few lines of output may be important and irretreivable; even losing the command history can be a PITA.

If you want to make it an option to suppress this when at a prompt, that's fine, but I still feel the default should be safe-but-noisy, not quiet-but-dangerous.

> My pattern to close a tab is to press Ctrl+D in the shell.

Ok, you've changed my mind. Robert, given the rest of that paragraph, *do* we really need a close-tab shortcut? (Though I admit, I'm not nearly so bothered by having one, but I agree with Matthias' argument that it doesn't seem necessary.)
Comment 8 Robert Knight 2008-08-01 15:36:56 UTC
> *Always*, please. Just because I'm at a command prompt doesn't mean
> there is no way I will lose valuable data/work if I accidentally close the tab.

No - I am very sure that would be very irritating for a lot of users and certainly for me personally.  As I said, I haven't heard about this before so I would suggest that you just change the shortcut in your settings.  If it comes up again I might re-visit it.

Vim has good recovery facilities in any case.

> Ok, you've changed my mind. Robert, given the rest of that paragraph,
> *do* we really need a close-tab shortcut?

Yes, because Ctrl-D/Ctrl+C do not work with all applications.  The close-tab shortcut works regardless of what is running.

Comment 9 Matthias Kretz 2008-08-01 18:23:03 UTC
> > *Always*, please. Just because I'm at a command prompt doesn't mean
> > there is no way I will lose valuable data/work if I accidentally close
> > the tab.
>
> No - I am very sure that would be very irritating for a lot of users and
> certainly for me personally.  As I said, I haven't heard about this before
> so I would suggest that you just change the shortcut in your settings.  If
> it comes up again I might re-visit it.


I see two cases here:
1) the application/shell that was running in the tab quit and the tab is 
consequently removed. This does not need a confirmation to remove the tab as 
there's no need for the tab anymore.
2) the tab was requested to be closed by a keyboard shortcut or mouse action 
while the shell/application is still running. In that case closing the tab 
might result in data loss and IMO Konsole should always ask for confirmation 
(you might want to make a distinction between shell and app and add a "don't 
ask again", that's fine with me). But per default it should be very careful 
(IMO).

> Vim has good recovery facilities in any case.


Sorry, but that's not an argument for leaving a potentially destructive action 
without confirmation.

> > Ok, you've changed my mind. Robert, given the rest of that paragraph,
> > *do* we really need a close-tab shortcut?
>
> Yes, because Ctrl-D/Ctrl+C do not work with all applications.  The
> close-tab shortcut works regardless of what is running.


Please reread what I said. Or at least let me know that you read and 
understood what I've written - because from that answer it looks very much 
like you didn't understand what I was saying.
Comment 10 Robert Knight 2008-08-01 19:18:44 UTC
> But per default it should be very careful (IMO).

There is another bug report about prompting when closing if an application is running in the shell, with the exception of a specified set of applications (which by default includes the user's shell, ssh etc.).  I agreed with that report and said that I would implement it.  On your PC you can remove the shell from the default list of 'safe' applications and you'll get a prompt every time - but I am convinced that prompting every time you press close tab or close window would irritate a lot of users.  



Comment 11 Jos van den Oever 2008-08-11 19:40:17 UTC
I agree with Matthias Kretz that there is no need for a tab closing shortcut since konsole only needs to close the tab in case of an exception.
In addition, on the version I'm using 2.1 (ubuntu deb), there is not option to turn off this shortcut. In the configuration dialog, 'Close Active' is set to ctrl-shift-s, which does not work, but acts as 'ctrl-s' triggering the 'ctrl-q' tip.
ctrl-shift-w is not visible in the list of shortcuts, but it *does* work.

At the very least it should be possible to turn off this shortcut.
Comment 12 Richard Hartmann 2008-09-11 19:40:19 UTC
I agree that, for the way I work, CTRL-D is the only method to close tabs I need & use. Everything else is possible source of data loss. Just filed wishlist item about the middle click:
http://bugs.kde.org/show_bug.cgi?id=170871
Comment 13 Robert Knight 2008-09-12 13:27:22 UTC
> At the very least it should be possible to turn off this shortcut.

That is a bug which is fixed in trunk.  I think I still need to backport it to KDE 4.1 though.  All shortcuts should now be change/remove-able 

> Please reread what I said. Or at least let me know that you read and
> understood what I've written - because from that answer it looks very much
> like you didn't understand what I was saying. 

I believe that I understand perfectly.

> Sorry, but that's not an argument for leaving a potentially
> destructive action without confirmation. 

Yes it is - if an action is undo-able then it isn't destructive.  Look, I agree that Konsole should try to be aware if you are running 
an activity in the shell (as opposed to being an idle prompt) and prevent accidental closure.  

Generally speaking though, I don't think that confirmation dialogs are a good way of preventing users from accidentally losing data, for the simple reason that a lot of the time people don't read them but just look for the 'get this dialog out of the way' button.  This is why Firefox, Chrome and IE employ such subtle alerts when visiting 'attack sites'. 



Comment 14 Robert Knight 2008-09-12 13:27:38 UTC
> At the very least it should be possible to turn off this shortcut.

That is a bug which is fixed in trunk.  I think I still need to backport it to KDE 4.1 though.  All shortcuts should now be change/remove-able 

> Please reread what I said. Or at least let me know that you read and
> understood what I've written - because from that answer it looks very much
> like you didn't understand what I was saying. 

I believe that I understand perfectly.

> Sorry, but that's not an argument for leaving a potentially
> destructive action without confirmation. 

Yes it is - if an action is undo-able then it isn't destructive.  Look, I agree that Konsole should try to be aware if you are running 
an activity in the shell (as opposed to being an idle prompt) and prevent accidental closure.  

Generally speaking though, I don't think that confirmation dialogs are a good way of preventing users from accidentally losing data, for the simple reason that a lot of the time people don't read them but just look for the 'get this dialog out of the way' button.  



Comment 15 Robert Knight 2008-09-22 11:58:43 UTC
Show close confirmation dialog when closing a session with Ctrl+Shift+W if the active program
is not the shell.

BUG:167869