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 87771 - confirm exit
confirm exit
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: 2.7
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 88107 112635 127374 147123 147814 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-07-09 18:11 UTC by Stephane Chauveau
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
add confirmation dialog when closing windows with > 1 tabs (5.00 KB, patch)
2003-06-30 05:30 UTC, Mariano Suárez-Alvarez
none Details | Review
Use Calum's wording and move the patch to HEAD (5.47 KB, patch)
2004-01-25 05:59 UTC, Mariano Suárez-Alvarez
committed Details | Review
The confirmation dialog (12.90 KB, image/png)
2004-01-25 06:00 UTC, Mariano Suárez-Alvarez
  Details

Description Stephane Chauveau 2002-07-09 18:11:07 UTC
gnome-terminal should have an option to ask for confirmation before closing
the window or a tab or changing a tab profile.

Also, I would appreciate if the 'close window' events was catched to close
the current tab only.
Comment 1 Havoc Pennington 2002-07-09 20:12:12 UTC
There are probably two dozen requests-for-preferences in here that are
more important, and the prefs dialog is already full... ;-) So I'm not
optimistic this makes sense.

I don't think it's a preference anyway; no user really wants it to
task always, or ask never. What you want is for the terminal to ask
for confirmation of close if closing would cause data loss. So the
right thing may be an escape sequence that Emacs or whatever is inside
the terminal can send to indicate that there's unsaved data or not.

Closing a tab when clicking the close button is just broken IMO, 
Acroread is the only thing I know of that does that, and it drives me
nuts. There's another bug open in here with a patch that adds a close
button to the tab itself, which is how I'd approach it.
Comment 2 Stephane Chauveau 2002-07-09 20:38:31 UTC
I somehow aggree with your most of your remarks however I 
also believe that closing should be confirmed at least 
when multiple tabs are opened. 

I tried several times to use 'multi-sessions' terminals 
and I always gave up because I was loosing too much jobs 
this way.


 

Comment 3 Luis Villa 2002-07-10 17:23:41 UTC
OS/X has a fairly nice 'here is a confirm dialog'  popup for this
case. I admit I'd turn it off immediately but I could see it being
useful, I guess.
Comment 4 Havoc Pennington 2002-09-22 22:06:14 UTC
Confirmation if we have > 1 tab open might be a nice idea.
Comment 5 Havoc Pennington 2002-09-22 22:27:38 UTC
*** Bug 88107 has been marked as a duplicate of this bug. ***
Comment 6 Calum Benson 2002-10-21 15:06:35 UTC
I was going to say whatever we decide here should be written into the
HIG, but of course in our Star Trek Future we want the window manager
to be in charge of tabbing in cases like this anyway so we shouldn't
have to ;)

Personally I like the way Galeon does it too, i.e. only asks for
confirmation if you have more than one tab open-- that's saved me a
couple of times...
Comment 7 Mariano Suárez-Alvarez 2003-06-30 05:27:37 UTC
Having just been bitten by this... here goes a patch that adds a
confirmation dialog when closing a window on which there is more than
1 tab open. 

It adds a gconf key (/apps/gnome-terminal/global/confirm_window_close)
which toggles this behaviour, but does not introduce ui to change it.
Latest mozilla has a ``don't show this again'' check-box in the
confirmation dialog...
Comment 8 Mariano Suárez-Alvarez 2003-06-30 05:30:29 UTC
Created attachment 17911 [details] [review]
add confirmation dialog when closing windows with > 1 tabs
Comment 9 Olav Vitters 2003-07-08 07:04:52 UTC
*** Bug 112635 has been marked as a duplicate of this bug. ***
Comment 10 Mariano Suárez-Alvarez 2003-11-19 10:40:10 UTC
*** Bug 127374 has been marked as a duplicate of this bug. ***
Comment 11 Bryan W Clark 2004-01-18 17:21:40 UTC
Ok, this looks good to me except the dialog text.

Instead of "Do you really want to close this window?", which kind of
questions the users judgment in hitting the close button (i tend to
believe the user is always right and the computer makes all the
mistakes :-).

How about something like: "The other tabs in this terminal will be
closed as well"

Perhaps we can get some more comments on the wording and apply this
patch, although it won't make it for the current release.
Comment 12 Calum Benson 2004-01-19 16:42:08 UTC
Agree... how about something like (remembering that the HIG style is
for bold+large primary text, followed by regular secondary text):

<b+l>Close all tabs?</b+l>
This window has [n] tabs open.  Closing the window will
also close all its tabs.

                              [Cancel] [Close All Tabs]
Comment 13 Bryan W Clark 2004-01-19 17:05:48 UTC
Rock, Calum's the man.  I like the wording of this and it looks good
from a HIG perspective.
Comment 14 Mariano Suárez-Alvarez 2004-01-25 05:57:38 UTC
Follows a patch which implements Calum's wording on current HEAD and a
screenshot of the dialog window (a windowshot?)
If I get approval from the release team (we are past the feature
freeze) I'll commit this, if it's ok?
Comment 15 Mariano Suárez-Alvarez 2004-01-25 05:59:08 UTC
Created attachment 23718 [details] [review]
Use Calum's wording and move the patch to HEAD
Comment 16 Mariano Suárez-Alvarez 2004-01-25 06:00:04 UTC
Created attachment 23719 [details]
The confirmation dialog
Comment 17 Calum Benson 2004-01-27 17:07:07 UTC
Alert looks good, but is "Cancel" the default button?  It would
probably be better if "Close All Tabs" was the default, even though
that's the more destructive action-- keyboard users hate having to hit
Tab-Enter to confirm things that they knew they wanted to do anyway :)
Comment 18 Tim Yamin 2004-02-29 21:24:05 UTC
Same point as Calum, should the dialog really use "Cancel" as the
default? Often when closing the dialog you really do want to close all
the windows, it's just a nice idea to have notification first if you
happen to close it accidentally.

You should be OK with doing
"gtk_dialog_set_default_response(GTK_DIALOG (dialog),
GTK_RESPONSE_YES);" before gtk_dialog_run to get that...

Also is "if (gtk_notebook_get_n_pages (GTK_NOTEBOOK
(window->priv->notebook)) <= 1)" really needed? You're doing casting
and using a much longer code route [ GTKNotebook vs. GList ] than just
simply using "if(g_list_length(window->priv->tab_menuitems) <= 1)"...
Comment 19 Mariano Suárez-Alvarez 2004-02-29 22:59:13 UTC
I'll change the default. I suspect the HIG's “Do not make a button the
default if its action is irreversible, destructive or otherwise
inconvenient to the user” will be invoked around next ui review time... ;)

Changing target so that I see this by 2.7 time.

-- 

Thanks for the gtk api reminder, I guess.

Counting menu items when what you want is to know how many notebook
pages there are is rather roundabout, don't you think? Also,
gtk_notebook_get_n_pages is a very descritive name, which makes things
pretty obvious, and does not depend on the rest of the app maintaining
an invariant (the length of the tabs menu is always equal to the
number of pages in the notebook). Note that g_list_length is rather
wasteful, too, if one wants be strict: “if
(window->priv->tab_menuitems && window->priv->tab_menuitems->next)
...” is an O(1) test that accomplishes the same thing, and, in fact,
the left side of the && can even be left out, since gnome-terminal
hopefully has “windows always have at least on tab” as an invariant.
Comment 20 Elijah Newren 2004-03-10 21:47:00 UTC
I'm cleaning out the extra GNOMEVER keywords and adding the
BLOCKED_BY_FREEZE keyword.
Comment 21 Mariano Suárez-Alvarez 2004-05-07 22:43:31 UTC
I changed the default response to "Close all tabs", and committed this on HEAD.
Thanks all.
Comment 22 Olav Vitters 2004-07-09 16:41:07 UTC
*** Bug 147123 has been marked as a duplicate of this bug. ***
Comment 23 Olav Vitters 2004-07-18 11:54:03 UTC
*** Bug 147814 has been marked as a duplicate of this bug. ***