Closed Bug 341067 Opened 19 years ago Closed 19 years ago

When Auto-hide is off, ctrl-w does not close the window when it is the last tab

Categories

(Firefox :: Tabbed Browser, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: sugoibaka, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060610 Minefield/3.0a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060610 Minefield/3.0a1

When "Hide the tab bar when only one web site is open" option is unchecked, pressing ctrl-w won't close the window if it is the last tab and it is about:blank.
When it is checked, the window closes properly.

Reproducible: Always

Steps to Reproduce:
1. Uncheck "Hide the tab bar when only one web site is open" in tab options.
2. Press ctrl-w a couple of times until all tabs close.


Actual Results:  
The window refreshes and stays in the blank tab.

Expected Results:  
When a non-blank tab is open, the tab closes.
If it is last, then it turns blank.
If the last tab is blank, the window is closed.
This is intended behaviour (bug 236721)
Blocks: 236721
Indeed.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
What about cases when a script opens a window without a tabber (for example: Gamespot's screenshots)?
Pressing ctrl-w now blanks the page and adds a tab-bar.
I now am forced to use a different shortcut to close the window instead of the standard ctrl-w, even when the tab-bar is not shown!

If only there was a way to force it to open the page in a tab instead of a window :(
Tomer, please file a separate bug on comment 3, we should rely on the tabbar visibility, not on the pref itself... (make a dependency on bug 236721 please)
Bug 341097 was filed for comment 3.
*** Bug 344675 has been marked as a duplicate of this bug. ***
*** Bug 344841 has been marked as a duplicate of this bug. ***
*** Bug 344758 has been marked as a duplicate of this bug. ***
*** Bug 348031 has been marked as a duplicate of this bug. ***
This is intentional?  Why on earth would I want Close to not close??
(In reply to comment #10)
> This is intentional?  Why on earth would I want Close to not close??

Ctrl+W is "close tab", Ctrl+Shift+W is "close window", when the tabbar is set to "always visible".
That's really annoying behavior.  Having the menu key equivalents  work differently depending on a preference setting is really bady form.
This new ctrl-w behavior is *tremendously* annoying, but less annoying than the screen "jiggle" from checking "hide tab bar when only one website open".  So I guess it's going to get checked.  I had it unchecked for one reason - to avoid annoying and needless screen movement when dropping from multiple tabs down to one tab.  

Stupid compromises. Logic aside, I would have preferred a preference setting to make both behaviors work, ctrl-w and "hide", (see the wiki) - so what it the bug fix is more than one line.

from bug 236721 comment 55 (a great analysis btw):
  ...a page giving the use cases, and my understanding of the pros & cons at:
  http://wiki.mozilla.org/Ctrl_W_not_close_app "
This behavior is still driving me crazy.  It's not like my Mac is a Windows machine, where closing the window quits the application.
*** Bug 355922 has been marked as a duplicate of this bug. ***
If people keep reporting this as a bug (hence the numerous duplicates), perhaps you should revisit this decision. Users expect that control-W/command-W will close the "current document" which, in a browser with only one tab, is the main window. This is a standard according to Microsoft's UI guidelines, Apple's UI Guidelines, Sun's UI Guidelines, Gnome's UI Guidelines, and anyone else who has bothered to publish guidelines.

I can buy that "current document" in a tabbed UI is the current tab, but when there's only one tab in a window, the entire window becomes the current document.

Please reconsider closing this bug as "resolved."
(In reply to comment #16)

Firefox used to close completely w/ Ctrl-w.  Now it doesn't, which is annoying if you have multiple browsers open w/ their own tab sets, and you want to have a keyboard shortcut to close the current browser.

Perhaps Ctrl-Q to quit the browser.  Ctrl-W to close a document window would make everyone happy.
I just thought I'd mention that while I've seen it mentioned here and there, I don't think anyone as clearly stated that the resolution to bug 236721 was very Windows/Unix-centric. The initial problem that bug 236721 "solved" was that Firefox quit if you pressed ctrl-W on the last tab. Mac OSX never had that problem, because closing the last window does not exit the program.

All other Mac OSX browsers that I am aware of exhibit the old behaviour, including Safari in tabbed mode.
I'd like to suggest that at least on Mac OS X, the old behavior should be restored.
*** Bug 357724 has been marked as a duplicate of this bug. ***
I'd be a lot less unhappy about this change in behaviour if people could name
/any/ other application that does this. Just one?

How hard is an extension to fix the bug? Anyone working on it? Can we edit
chrome somehow?

Have the people who implemented this change in behaviour considered how bad Alt-F4 and C-S-w are in terms of RSI?
At the very least, when it closes the last tab, it should focus the address bar by default. At the moment, it seems to focus the tab, which is an utterly useless place to have focus when you just closed it.
I would like to offer more opinion on this.  Even the previous version of FireFox would automatically close the window when only a single tab was open.

Likewise, if the functionality is to "close the current document" only, why does the window not close when there are no active tabs?
> I'd be a lot less unhappy about this change in behaviour if people could name
> /any/ other application that does this. Just one?

The apps I'm aware of where ctrl-W closes the current document if there are multiple documents, but keeps the app open if it's the last document are: Microsoft Word. Microsoft PowerPoint. Microsoft Excel. Microsoft Access. NetCaptor web browser. GEdit (GNOME text editor). Internet Explorer 7. Opera.

> Perhaps Ctrl-Q to quit the browser.

Seamonkey has/had that keyboard shortcut, and it lead to bug 52821 because people would accidentally press Ctrl-Q when they wanted Ctrl-W. Presumably to prevent this, ctrl-Q was omitted from Firefox.

> Mac OSX never had that
> problem, because closing the last window does not exit the program.

Ah, didn't know that (I don't use OSX). In that case, yes, I can see it's solving a problem you never experienced by making the app do something you don't need or want, and I can see why that would be annoying. A conditional for OSX could be the way to go, if the Firefox devs are happy with that - they're kind of in a difficult situation trying to support 3 different OSes which are all slightly different in their behaviour, all whilst trying to have the same UI and app behaviour, as demonstrated by this bug.

> This is a standard according to Microsoft's UI guidelines, Apple's 
> UI Guidelines, Sun's UI Guidelines, Gnome's UI Guidelines, and 
> anyone else who has bothered to publish guidelines.

Can you provide references to back that up please? When I searched, here's what I found:
* The Apple one does say anything about command-W: http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGKeyboardShortcuts/chapter_20_section_1.html#//apple_ref/doc/uid/TP40002725-CHDIGFBH (i.e. "Close the active window"). [Question: I'm confused - if you have multiple tabs open in one window, if you actually do what it's saying, then you'll close every single one of those tabs by pressing command-W ... how can that be good? Or in OSX does Firefox not have tabs in a single window? Rather you have multiple windows, without any tabs?]
* The Microsoft "Keyboard Interface Summary" of the "Official Guidelines for User Interface Developers and Designers" does not seem to say anything about Ctrl-W:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/appxb.asp
* The GNOME "Standard Application Shortcut Keys" lists Ctrl-W as "Close the current document" (as distinct from "Quit the application", which has a different shortcut key). http://developer.gnome.org/projects/gup/hig/1.0/userinput.html#standard-shortcuts
* I'm not sure what Sun has do with this; you can't even download Firefox from the primary download site ( http://www.mozilla.com/en-US/firefox/all.html ) for Solaris or SunOS, and for Linux stuff the KDE and GNOME folks are I suspect in a better position to the define standard UI behaviour.
I run Windows XP, and the only windowed application I have experienced this behavior on is Adobe Reader. Every other app closes with ctrl+w. I'm certain there are other exceptions, but ctrl+w is a standard close command, and a much nicer one than alt+F4.

Actually, I just opened OpenOffice.org 2.0, and though it does not close if you press ctrl+w with a document open. However, pressing ctrl+w again will close OpenOffice.org. Might similar behavior be appropriate here? This might even be consistent with Word, I haven't a copy on my computer.

In any case, I reiterate that focus should move to the address bar when the last tab is blanked, since (I presume) anyone blanking the last tab is about to type in an address.
Yes, this is my concern: this behavior is very odd (and even wrong) on Mac OS X, and at a minimum should be addressed there.
(In reply to comment #24)
> The apps I'm aware of where ctrl-W closes the current document if there are
> multiple documents, but keeps the app open if it's the last document are:
> Microsoft Word. Microsoft PowerPoint. Microsoft Excel. Microsoft Access.
> NetCaptor web browser. GEdit (GNOME text editor). Internet Explorer 7. Opera.
Yes, except that all of these SDI applications (that I've had experience with) will suddenly take on the appearence of their MDI app predecessors and remain open in a zero document state. Interestingly enough, I think if it were to be suggested that Firefox enter a zero tab state, where no page can be loaded without openning a new tab, which would be consistent with these programs, I think people would complain that it is inefficient. Personally, I would actually appreciate such a behaviour, because my default reaction to wanting to open a new page in Firefox is to alt-tab into it if necessary and hit ctrl-T. I wouldn't have to worry about whether or not there was a suitable tab to use already. It would certainly be more consistent and stop me from complaining about the current behaviour. :)

I still think whether or not ctrl-W closes the last window should be a seperate option. People who don't use tabs might find it useful too, as evidenced by the SDI applications (MS Word, Acrobat Reader, etc.) that can close the last document without closing the last window. Even if that option is only accessible in about:config.

Of course, if Firefox were able to go into a no document state, both New Window (Ctrl-N) and New Tab (Ctrl-T) should probably just reopen a tab in the last window.

> * The Apple one does say anything about command-W:
> http://tinyurl.com/ge3eg
> (i.e. "Close the active window"). [Question: I'm confused - if you have
> multiple tabs open in one window, if you actually do what it's saying, then
> you'll close every single one of those tabs by pressing command-W ... how can
> that be good? Or in OSX does Firefox not have tabs in a single window? Rather
> you have multiple windows, without any tabs?]

There seems to be some confusion on this point, because the Apple HIG doesn't seem to say anything about Tabbed Document Interfaces, so I'll attempt to clarify based on my experiences with the OSX interface. First, tabs are in a single window, unless you open more, the same as Windows and X11. Cmd-W also closes a single tab. This is all consistent with other OSX applications with tabs, including Apple's own Safari in tabbed mode. If you press Cmd-W on the last tab, the behaviour in all programs I'm aware of other than Firefox is to close the window and leave the application running. You can still access the application through the Mac universal menubar and keyboard shortcuts.

I have also seen some confusion about the meaning of Cmd-Shift-W in Mac OSX. The intended meaning by the Apple HIG is to close a document and all related windows, instead of just the active window. This is relevant if you are working on a document with multiple views. It should be noted that in tabbed mode, Apple's Safari uses Firefox's behaviour, which is to close the foreground window and all tabs in that window. This is probably due to the fact that a way to close a window is needed, and the classic interpretation of Cmd-Shift-W doesn't make sense in a web browser. Safari's Cmd-Shift-W does not warn the user.

As an aside, the defined behaviour by Apple's HIG for Cmd-Opt-W is to close ALL windows and effectively clearing the application, but leaving it available to open new documents. Apple's Safari is inconsistent in this behaviour when in tabbed mode. If the foreground window only has one tab open, Cmd-Opt-W indeed closes all windows, but if the foreground window has multiple tabs open, it has the effect of closing all tabs in the window except for the active tab. I personally find Safari's behaviour in this regard somewhat confusing.

Firefox does not respond to Cmd-Opt-W.


(In reply to comment #25)
> Actually, I just opened OpenOffice.org 2.0, and though it does not close if you
> press ctrl+w with a document open. However, pressing ctrl+w again will close
> OpenOffice.org. Might similar behavior be appropriate here? This might even be
> consistent with Word, I haven't a copy on my computer.

Just checked Word 2000. It isn't. I would be opposed to this, personally. Much like various tweakable options, it is my observation that open source projects tend to pick up lots of little UI optimisations and shortcuts that aren't inituitive to new users, are inconsistent with the host environment's conventions, and provide diminishing returns to those who can keep track of them all. I feel like hitting ctrl-w twice could be one of those things, unless it can be shown that enough mainstream programs do this that it feels consistent with the environment. It may indeed be consistent with one or more of the X11/Linux desktop conventions, but I doubt it on Windows.

Part of why I am opposed to the current behaviour is it felt to me to be like another one of those situations. It certainly is inconsistent on Mac OSX. Pointing out that apps like Word and Acrobat do something similar may've changed my mind slightly for Windows, but I still think if the behaviour is at all optional, it shouldn't be tied to a seemingly unrelated option of hiding the tab bar.
> The apps I'm aware of where ctrl-W closes the current document if there are
> multiple documents, but keeps the app open if it's the last document are:

I'm not asking what keeps the
application open if it's the last window, I'm asking which application keeps
*EVERY* window open if you try to close it, which is exactly what this bug
is about (or at least, what /my/ bug was about - if this is different,
my bug should be un-duped).

I do not object to the behaviour of keeping the very last firefox window open.
Mozilla should restore the previous functionality (i.e. close window on last Ctrl-W) because...

1. It's how FF used to operate (why change?)

2. It's better (why not remain an innovator instead of a follower?)

If you think *this* reaction from beta testers is a pain, wait til you see what happens when the whole world of Firefox users starts using 2.0.  The flood of tech support (to whatever level it rises) isn't worth it.  Stay with what was.  Remain an innovator.
> However, pressing ctrl+w again will close OpenOffice.org.

Changing the behaviour of a hotkey depending on whether your last tab is blank (which presumably is how this would be done) is seems like it could be quite confusing and inconsistent.

> In any case, I reiterate that focus should move to the address bar when the
> last tab is blanked, since (I presume) anyone blanking the last tab is about to
> type in an address.

That makes good sense. The user is most likely either about to type in a new address, or open a bookmark (which in turn causes the address bar to lose its focus, and give the active tab the focus, which is what the user would expect).

> I think if it were to be
> suggested that Firefox enter a zero tab state, where no page can be loaded
> without opening a new tab, which would be consistent with these programs, I
> think people would complain that it is inefficient. Personally, I would
> actually appreciate such a behaviour

I think there was a bug asking for that at one stage (which I can't find right now), but (I think) it got closed as wontfix. So I think the "no document state" may be a non-starter (of course, I could be wrong).

> It's better (why not remain an innovator instead of a follower?)

That's not very helpful and besides it misses the point. The point is get a user-interface that keeps users happy. Most of the world could care less about innovation, they just want easy-to-use, where the definition of "easy-to-use" is different for different people.

> I still think whether or not ctrl-W closes the last window should
> be a separate option.

Yes, I'm coming to the same conclusion - people have very individual browsing styles, and tying this behaviour to a seeming unrelated preference just causes confusion. So at this stage, can I please suggest a possible compromise to try and keep everyone happy?

* A bug is logged requesting that a separate preference be added determining what happens on ctrl-W, completely separate and distinct from the auto-hide preference for the tab bar. Possible options for behaviour should include: A) Close window [i.e. 1.5 behaviour] B) Keep window open with a blank tab [i.e. 2.0 beta behaviour] C) Keep window open with a blank tab if it is the last window, otherwise close the window [middle ground between A & B]. OSX should default to A), and others should default to C), but users can then change from the default as desired using this preference.

* A bug is logged (possibly by Luke?) requesting that the address bar gets the focus if this is the last tab, and the window was kept open.

* A bug is logged (possibly by Jonathan?) requesting that Cmd-Opt-W on OSX closes-all-tabs, but keeps Firefox running.

Would everyone be happy with this? Is there anyone that would be unhappy with this? And if so, what needs to be changed to make everyone happy with this?
Also happens on Linux, so OS should be All, but I cannot change it.

My problem with this is that it is inconsistent; having the tab bar always show shouldn't change the close tab behaviour (or anything else; the only change should be that the tab bar doesn't autohide when there is a single tab).
*** Bug 358207 has been marked as a duplicate of this bug. ***
Talking about inconsistent: If you closely watch Firefox 1.5, you'll see that when only one tab is opened, you'll have either a "File -> Close Tab" or a "File -> Close" menu description for Ctrl+W.

Now ask yourself: what keeps you from hiding the tab bar when only one tab is open (as does Safari, in which case both browsers behave the same)?

Keeping the tab bar always visible can IMO be considered a good indicator that you consider Firefox rather an MDI application (as Adobe Reader, Opera or Microsoft Word) than an SDI application (as MSIE). And MDI applications simply aren't closed when the last document is. Of course, Firefox isn't really either MDI nor SDI but a hybrid with a tendency to either side.

As for OS X: I'm not sure whether the concept of an MDI application is known there. If it isn't, feel free to file a bug for reverting this behavior on OS X only. The same applies to Linux, though arguing about Linux and consistency could be quite difficult to begin with. ;-)

(In reply to comment #25)
> In any case, I reiterate that focus should move to the address bar when the
> last tab is blanked

Please file a bug to that end.

(In reply to comment #30)
> people have very individual browsing styles,

Which Firefox might not always fulfill, that's what we've got extensions (and SeaMonkey) for.

> So at this stage, can I please suggest a possible compromise to try
> and keep everyone happy?

Please kindly note that the aim of Firefox isn't to keep everybody happy by default, but rather to provide a clean browsing experience to the majority of its users and allow users with different needs to change most of the UI through simple extensions.

> C) Keep window open with a blank tab if it is the last
> window, otherwise close the window

Do you really expect a user to count open browser windows before hitting Ctrl+W? Either s/he wants to close the tab and the window or s/he only wants to close the tab but not the window. The "application" itself doesn't mean much to most users.

And having this option as a default will annoy many more users, since a considerable amount of them still expects Ctrl+W to close the window (the crowd having the tab bar hidden, which happens to be the default setting).
Status: RESOLVED → VERIFIED
could somebody tell me the purpose of opening an "about:blank" tab anyway?  it seems like we're erasing 10+ years of muscle memory (ctrl-w means close current tab/window) for an absolutely useless feature.  i can't see how this benefits anyone at all.
(In reply to comment #34)
> (ctrl-w means close current tab/window)

The problem is that it usually means either "close tab" (MDI applications) OR "close window" (SDI application), but never "close tab AND window".

Although with the exception of Internet Explorer and Windows Explorer (and OpenOffice, but I consider that a bug), I've yet to see an application where Ctrl+W closes the window. That's what we've got Alt+F4 for.

> i can't see how this benefits anyone at all.

Just read through bug 236721 to meet some of the people who actively requested this change...
>Do you really expect a user to count open browser windows before hitting
>Ctrl+W? Either s/he wants to close the tab and the window or s/he only wants to
>close the tab but not the window. The "application" itself doesn't mean much to
>most users.

Huh? What has counting got to do with it? Indeed the user /does/ want to close the window! That's why they pressed the same keys that close windows in many, many, other applications. What they don't presumably want to happen is quit the application.
> The problem is that it usually means either "close tab" (MDI applications) OR
> "close window" (SDI application), but never "close tab AND window".

every version of mozilla suite and firefox up until now, for one example...

> Although with the exception of Internet Explorer and Windows Explorer (and
> OpenOffice, but I consider that a bug), I've yet to see an application where
> Ctrl+W closes the window. That's what we've got Alt+F4 for.

every web browser i've ever used with the exception of recent versions of opera.  and i've been using the internet for a good 10 years.  and IE and WE are pretty heavy hitters to discount as an exception, no?  i'm sure i could come up with some other examples if you'd like...

> Just read through bug 236721 to meet some of the people who actively requested
> this change...

but what purpose does it serve?  what good is a new "about:blank" tab?
> Huh? What has counting got to do with it? Indeed the user /does/ want to close
> the window! That's why they pressed the same keys that close windows in many,
> many, other applications. What they don't presumably want to happen is quit the
> application.

i don't think of it in terms of tabs/windows.  when i hit ctrl-w, i want to close the page i'm looking at now.  if the page i'm looking at now is the last tab in the current window, then yes i want to close that window. if it's the last tab in the last window, then yes i want to close the application.  the way i look at it, ctrl-w is still closing the current page.  the problem is, now in those two use cases i now get an extra absolutely useless feature: opening a new tab with "about:blank".  that does nobody any good.
(In reply to comment #36)
> What they don't presumably want to happen is quit the application.

Why would a user want to close a window but not the application? How many users do know the difference in the first place?

(In reply to comment #37)
> every version of mozilla suite and firefox up until now, for one example...

Just because they've forgotten to fix the bug so far... Also see the first paragraph of comment #33 which suggests that it was indeed the current behavior they had originally intended.

> i'm sure i could come up with some other examples if you'd like...

You've actually not mentioned a single application name so far (except Opera, but that was a counter-example ;-)).

> but what purpose does it serve?  what good is a new "about:blank" tab?

A blank tab is the closest Firefox will ever get to having no document open, so about:blank is sort of the equivalent of a blank MDI window. What else would you expect, Firefox loading your homepage?

(In reply to comment #38)
> i don't think of it in terms of tabs/windows.  when i hit ctrl-w, i want to
> close the page i'm looking at now.

Which is happening (supposing you weren't already looking at about:blank). Now you just have to tell Firefox that you also want it to close the window by indicating that you're rather the SDI kind of person and hide the tab bar when only that one tab is opened so that Firefox behaves like IE6.
> Just because they've forgotten to fix the bug so far... Also see the first
> paragraph of comment #33 which suggests that it was indeed the current behavior
> they had originally intended.

so it's been a bug for the last 12 years?  comment #33 was posted by you, and i assume you weren't a netscape programmer 12 years ago.  i don't really take it as authoritative.

> You've actually not mentioned a single application name so far (except Opera,
> but that was a counter-example ;-)).

the guy i was replying to said Internet Explorer, Windows Explorer, and OpenOffice.  those are some heavy hitters. ;]

> A blank tab is the closest Firefox will ever get to having no document open, so
> about:blank is sort of the equivalent of a blank MDI window. What else would
> you expect, Firefox loading your homepage?

a window with no tabs is no window at all.  my point exactly.  i made the page go away.  the window now has no pages, so it goes away too. -=]

> Which is happening (supposing you weren't already looking at about:blank). Now
> you just have to tell Firefox that you also want it to close the window by
> indicating that you're rather the SDI kind of person and hide the tab bar when
> only that one tab is opened so that Firefox behaves like IE6.

but firefox is neither MDI or SDI.  i'm a document-oriented kind of person, and that's how both firefox and mozilla suite worked until the were broken.  remember, microsoft considers MDI to be a failed experiment.
>Why would a user want to close a window but not the application?
>How many users do know the difference in the first place?

This is done all the time on the Mac.  It's a great way to get apps out of your way while you do other stuff, and without having to relaunch them later.  It's been the way Mac users have done things since, oh, 1988 or so.
(In reply to comment #40)
> i don't really take it as authoritative.

No worries, it wasn't meant as such.

> the guy i was replying to said Internet Explorer, Windows Explorer, and
> OpenOffice.  those are some heavy hitters. ;]

And the guy I was replying to said "Every other app closes with ctrl+w" (comment #25) which simply isn't true.

> a window with no tabs is no window at all.

Tell that Adobe Reader or any other MDI application...

> i'm a document-oriented kind of person, and
> that's how both firefox and mozilla suite worked until the were broken.

So, what again was wrong with just hiding the tab bar?

(In reply to comment #41)
> This is done all the time on the Mac.

It's not on any other OS though. So please file a new Mac specific bug.
I originally did file a Mac specific bug, and it was marked as a duplicate and referred to this bug.  If I file a new Mac specific bug, will that happen again? :)
I reopened bug 348031, no need to file a new one :)
> And the guy I was replying to said "Every other app closes with ctrl+w"
> (comment #25) which simply isn't true.

ah, yeah, i thought you were replying to me.  it's a web browser convention, not a general app convention.

> Tell that Adobe Reader or any other MDI application...

ah, but firefox isn't an MDI application, it's a tabbed application.  Adobe Reader's UI annoys the hell out of me, FWIW.

> So, what again was wrong with just hiding the tab bar?

it's distracting when i open a second tab.  the whole document shifts down.  additionally, i prefer to balance my close button on the right of the tab bar with a new tab button on the left of it, and in that case it would be hidden at times when i want to use it.  i really don't see any reason this pref should be bound to that one, though that's separate from the point of not seeing what use a new "about:blank" tab is to anyone at all.
*** Bug 358252 has been marked as a duplicate of this bug. ***
>> In any case, I reiterate that focus should move to the address bar when the
>> last tab is blanked

>Please file a bug to that end.

Done. Bug 358262.
The report was originally Mac OS specific but it was merged and I guess now un-merged.
Not sure if I understand the routine (bug filing) here quite right but I discovered something else as I was trying the suggested fix; when always on tab is deselected, comnd+W closes the window if there is only one tab left open. But this time, in a new window with no tabs showing, if you create a new tab, it creates two tabs at once. When you close one, the other one closes too. It is again on Mac but since the discussion was carried here, I am posting here.
> it's a web browser convention, not a general app convention.

That's just not true, at least for the multi-tab browsers. You've already listed Opera, and plus there's NetCaptor, probably the original multi-tabbed Internet-Explorer-based web browser, dating back to 1997, which pioneered many of the multi-tabbed behaviours which Firefox only reach parity with a year ago (e.g. dragging tabs), and in some ways it still hasn't reached parity with (tabs overflowing to multiple rows *without* requiring an extension, ditto for variable tab title width, it's only just got native session saving, etc etc), and where Ctrl-w will NOT close the app (gives a blank tab instead).

The best you can say is that some multi-tabbed browsers close on ctrl-w, and some do not. There simply is no standardized ctrl-W-on-last-tab behaviour for this category of application, and pretending there is won't make it so.

> though that's separate from the point of not seeing what use
> a new "about:blank" tab is to anyone at all.

Then please allow me to explain it. The purpose is to not exit the application. Exiting the application when you only wanted to close a tab is annoying, and besides that's what Alt-F4 is for. The desire is that the application doesn't exit, but the tab that you were looking at (and wanted to close with Ctrl-W) is now gone. A window with no tabs has been rejected previously, leaving about:blank as the main option. It's not that people particularly want a blank tab, rather they explicitly do NOT want the app to exit. Ctrl-W means "close just the active tab"; it does not mean "Quit the whole application".

> * A bug is logged (possibly by Jonathan?) requesting that Cmd-Opt-W 
> on OSX closes-all-tabs, but keeps Firefox running.

Just to follow up on this, it looks like this is bug 116120, but it hasn't seen any action in approaching 5 years.
(In reply to comment #39)
> A blank tab is the closest Firefox will ever get to having no document open, so
> about:blank is sort of the equivalent of a blank MDI window. What else would
> you expect, Firefox loading your homepage?

If Ctrl-W in the last tab made the window have zero tabs (so that you would have to open a new tab before going anywhere else), it would at least be more consistent than magically opening a new tab when you closed the last one. I would expect it to either close the window or close the last tab (making it have zero tabs open), instead of opening a new blank tab.
> That's just not true, at least for the multi-tab browsers. You've already
> listed Opera, and plus there's NetCaptor, probably the original multi-tabbed
> Internet-Explorer-based web browser, dating back to 1997, which pioneered many
> of the multi-tabbed behaviours which Firefox only reach parity with a year ago
> (e.g. dragging tabs), and in some ways it still hasn't reached parity with
> (tabs overflowing to multiple rows *without* requiring an extension, ditto for
> variable tab title width, it's only just got native session saving, etc etc),
> and where Ctrl-w will NOT close the app (gives a blank tab instead).

well, that's two.  i suppose we could research it.  but the fact is, if you look at web browsers for windows, just about all of them have ctrl-w to close the window.  heck, i think that's what the 'w' stands for!  as an aside, i seem to recall opera making it pretty easy to redefine ctrl-w to work the way i like it to.

> The best you can say is that some multi-tabbed browsers close on ctrl-w, and
> some do not. There simply is no standardized ctrl-W-on-last-tab behaviour for
> this category of application, and pretending there is won't make it so.

if you want to make multi-tabbed browsers a separate category from web browsers in general, i suppose that's true.

> Then please allow me to explain it. The purpose is to not exit the application.
> Exiting the application when you only wanted to close a tab is annoying, and
> besides that's what Alt-F4 is for. The desire is that the application doesn't
> exit, but the tab that you were looking at (and wanted to close with Ctrl-W) is
> now gone. A window with no tabs has been rejected previously, leaving
> about:blank as the main option. It's not that people particularly want a blank
> tab, rather they explicitly do NOT want the app to exit. Ctrl-W means "close
> just the active tab"; it does not mean "Quit the whole application".

but why wouldn't you want to close the application if you're closing the last tab? i simply don't understand that use case.  i close the page if i'm done with the page.  why would i want the web browser hanging around if i'm done with it?  

if i want to go to a new page, why would i close the tab?  why not just hit ctrl-l and type the new address?  this way, you hit ctrl-w, and then you still have to hit ctrl-l and type the new address!  it's an extra keystroke for nothing.
> but why wouldn't you want to close the application if you're closing the
> last tab? i simply don't understand that use case.  i close the page if
> i'm done with the page.  why would i want the web browser hanging around
> if i'm done with it?  

Because I'm not done with the browser. I still want the browser. I'm done with the tab. I want the old tab to close or blank (so that I can mark it as done with). I want the browser because it's a useful application to have open. If I wanted to close the browser, I'd go File->Exit, or Alt-F4, or double-click on the top left, or single click on the top right, or ctrl-shift-w.

> if i want to go to a new page, why would i close the tab? why not just hit
> ctrl-l and type the new address?  this way, you hit ctrl-w, and then you still
> have to hit ctrl-l and type the new address!  it's an extra keystroke for
> nothing.

Ah, but you're assuming that the "I'm done with this tab", and the "let's open a new page" always happen back-to-back. They might not. You could be researching something from a search engine, have 20 tabs with possible search answers open, find what you want, and then close all the open tabs very quickly by holding down ctrl-W, whilst not closing the application. This takes the browser back to it's default blank state, the same state you get on opening a browser (with the homepage set to about:blank) - i.e. a browser with just one blank tab open. Then 10 minutes later, suppose you need to find the answer to some other question, and off you go again. There are no wasted keystrokes because you're holding down the keys, and there is a defined empty state (i.e. the single blank tab, but a tabless window would also be equally fine with me), and the browser doesn't go around exiting on you unexpectedly sometimes when you press the close-tab hotkey.

> as an aside, i seem
> to recall opera making it pretty easy to redefine ctrl-w to work the
> way i like it to.

I think it should be a preference. The very fact we're having this conversation indicates to me that some people have a preference for a certain type of behaviour on closing the last tab, and others have a preference for the opposite behaviour. And both groups look at the other group's option with puzzlement and go "why would I want THAT?!" ;-) And it may well be that this preference is independent of whether people want the tab bar to hide or not.
> Because I'm not done with the browser. I still want the browser. I'm done with
> the tab. I want the old tab to close or blank (so that I can mark it as done
> with). I want the browser because it's a useful application to have open. If I> 
> wanted to close the browser, I'd go File->Exit, or Alt-F4, or double-click on
> the top left, or single click on the top right, or ctrl-shift-w.

most of those actions only close a single window, so you may still have the browser.  but, see, i think that's our big difference.  like i said, i'm document-centric.  i don't ever want "the browser", i want the document, and the browser is only a means to get it.  if i'm done with the document, i have no need for the browser.  if i want another document later, i'll need the browser again, but i have no reason to want it sitting there showing "about:blank" in between.

> Ah, but you're assuming that the "I'm done with this tab", and the "let's open
> a new page" always happen back-to-back. They might not. You could be
> researching something from a search engine, have 20 tabs with possible search
> answers open, find what you want, and then close all the open tabs very quickly
> by holding down ctrl-W, whilst not closing the application. 

if i've closed all the tabs, why does it matter if the application is still there?

> This takes the
> browser back to it's default blank state, the same state you get on opening a
> browser (with the homepage set to about:blank) - i.e. a browser with just one
> blank tab open. Then 10 minutes later, suppose you need to find the answer to
> some other question, and off you go again. 

then, when i say "i need the browser again", i start it again.

> There are no wasted keystrokes
> because you're holding down the keys, and there is a defined empty state (i.e.
> the single blank tab, but a tabless window would also be equally fine with me),
> and the browser doesn't go around exiting on you unexpectedly sometimes when
you press the close-tab hotkey.

whereas, to me, exiting is the expected and desired action, and now i see it unexpectedly creating a new, useless tab.

> I think it should be a preference. The very fact we're having this conversation
> indicates to me that some people have a preference for a certain type of
> behaviour on closing the last tab, and others have a preference for the
> opposite behaviour. And both groups look at the other group's option with
> puzzlement and go "why would I want THAT?!" ;-) And it may well be that this
> preference is independent of whether people want the tab bar to hide or not.

well i hope the devs take that into consideration.  for now, i've hacked browser.js to restore the old behavior.  it was either that or go back to 1.5; this behavior is way too frustrating.
> hacked browser.js

Can you share your hack please?
just reverse the change in the patch for bug 236721.
> for now, i've hacked
> browser.js to restore the old behavior.  it was either that or go back 
> to 1.5; this behavior is way too frustrating.

Yeah, I did the exact opposite (unpack the relevant JAR, modify browser.js to make Ctrl-W keep the window open on last tab, repack the JAR) in 1.5 and 1.0 because I found those versions frustrating. It's annoying that anyone has to go through that, and to me indicative of the need for a preference for this purpose.

Having been through this, the only advice I can offer is that you need to watch out for this any time you update your browser (can clobber the manual changes). A better solution may be to look at the Tab Mix Plus extension, in particular with this installed see "Tab Mix Plus Options" -> "Events" -> "Tab Closing" -> tick or untick "Do not close window when closing last tab by hotkey". It's not native to the browser, but it does at least avoid the hassle of modifying JavaScript source. The author has indicated s/he'll update it for 2.0 in the very near future, but it's not ready just yet ( homepage is: https://addons.mozilla.org/firefox/1122/ )
I posted a potential solution for this problem in bug 358573, one that I hope will satisfy the needs of both sides in this debate.  Could you please review the solution and post your comments as to whether or not it would work for you?

Thanks.
*** Bug 359153 has been marked as a duplicate of this bug. ***
ugh... i use a mix of tabs and windows and like having the tab bar always showing.  having to use ctrl-shift-w to close any window is terrible.  why not show a warning message if you try to close the last window using ctrl-w?  or maybe have only the last remaining window be closed by ctrl-shift-w?
VOTE! When last Tab is (untitled) or blank or unpopulated or simply empty: Ctrl+w has to close the window just as it does when "Hide the tab bar when only one tab is open" is activated!
ah I see! This blocks: [url=https://bugzilla.mozilla.org/show_bug.cgi?id=236721]236721[/url]. So why is there no option for? And why is the Ctrl+W behavior different in "Show Always Tabs"/"Hide Tab bar when single Tab". 236721 Does not explain this.
VOTE! There should be at least an option in about:config as there are clearly a lot of people who want this.

I want the tab bar to always be there, because otherwise when you go from one tab open (tab bar hidden) to multiple tabs open (tab bar shown), all the text you are viewing jumps to make room for the tab bar that appears.  It seems very illogical that if you choose this option, then it is now at the cost that ctrl-W will not close the window when closing the last tab.  Some people may prefer the window to remain open, but to deprive others of at least an option is nasty.  I see that Internet Explorer still closes the window on closing the last tab, so maybe I need to go back to using IE instead.
Which is more annoying to you:
- Having a strip of screen real estate (the tab bar) wasted when only 1 tab is present, duplicating information that's all already available in the title bar?
or
- Having the top of the document box jump up/down on the screen whenever the number of open tabs changes to/from 1?

THAT'S what the "Always show the tab bar" option is about, folks, and it's basically a question of whether your browsing behavior causes the number of tabs open at any given moment to be equal to 1 more often or less often than it's more than 1.  There's nothing in there about the behavior of the "Close" function(s), and there shouldn't be.

As for that question (the one that SHOULD be discussed here), there are three functions involved:  "Close Tab" (T for short), "Close Window" (W), and "Terminate Application" (A).

For MacOS apps, the convention (AFAICT) is that
T CAN imply W when nT(W) becomes 0, but
W DOESN'T imply A even if nW(A) does become 0;
whereas for Windows, it's the opposite -
T DOESN'T imply W even if nT(W) does become 0, but
W CAN imply A when nW(A) becomes 0.

This difference comes from the ubiquity of the MacOS menu bar; it makes MacOS the only OS where an app can be running with zero windows open and still provide for user interactivity.

So, my vote on this is to stop overloading the "show tab bar" option and add two others:  One would be marked "Close a window when closing the last tab in it", and would default to checked for MacOS, and unchecked everywhere else; the other would be marked "Close Firefox when closing the last window", and would default to unchecked for MacOS, and checked (and possibly hidden) everywhere else.

(My vote is also to flog the person who thought overloading the "show tab bar" option was a good idea in the first place; without that, years of churn on this issue could have been avoided.  And could whoever marked this bug "INVALID" please explain how that decision was arrived at?)
> My vote is also to flog the person who thought overloading the "show tab bar"
> option was a good idea in the first place

I think the concern at the time was that there were already too many
configuration preferences, so rather than introducing a new preference, it was
decided to recycle an existing preference to cover this functionality too.

> years of churn on this issue could have been avoided

Yes, based on the resulting conflict over this, I fully agree that a separate
boolean "close window on closing last tab" setting would have avoided the
disagreement over this, and is still probably the way to go to so that everyone
can specify the behavior they want. (Although IMHO it should not be based on
whether the last tab's URI is "about:blank", which is what's currently happening
in the patch attached to bug 358573).
I'm the one who suggested the "fix" in bug 358573.  Personally, I agree with you - there should absolutely be a preference for this, whether in the UI or otherwise accessible through user.ini.  However, given that the minority of people who feel otherwise apparently hold the power, I put that forth as a suggestion for compromise.  For what it's worth, I've been using it on my own browser installs for the last year or so (I always repack the browser.jar file with the "fix" after upgrading), and it works pretty damn well once you get used to it.

The unfortunate thing is that neither it nor a proper preference option has been added.
You need to log in before you can comment on or make changes to this bug.