Open Bug 490136 Opened 11 years ago Updated 4 months ago

When firefox is exited by closing the last tab, that tab is restored on restart

Categories

(Firefox :: Session Restore, enhancement)

enhancement
Not set

Tracking

()

UNCONFIRMED

People

(Reporter: vulcanb, Unassigned)

Details

(Whiteboard: [invalid?][session-store-testday])

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.9) Gecko/2009042113 Ubuntu/8.10 (intrepid) Firefox/3.0.9
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.9) Gecko/2009042113 Ubuntu/8.10 (intrepid) Firefox/3.0.9

If I close Firefox by closing the last open tab, and Firefox is set to restore the last open tabs on restart, it reopens the tab that I've explicitly closed. To me, closing a tab is a signal that I am done with it - if Firefox is exited this way, I would rather that my homepage be the page that is opened on the next Firefox startup.

Reproducible: Always

Steps to Reproduce:
1. Set Firefox's startup behaviour to "Show my windows and tabs from last time".
2. Exit Firefox by closing the last open tab.
3. Open Firefox again
Actual Results:  
The tab I explicitly closed is opened again.

Expected Results:  
A tab I explicitly closed should stay closed - my homepage would be a good alternative to bring up on restart.
When the last open tab is closed, it leaves firefox with nothing, so firefox closes as well. 3.5 has some modifications with how tab closing works. At least with 3.6, but I believe with 3.5 as well, it is impossible to close the last tab, you must close the window.
Here is perhaps an illustrative use scenario. I open Google Reader, and spawn anything that looks interesting in new tabs. If I have to shut down before I've read all the articles, I'd like them to be restored when I re-open Firefox. If I finish them all, when I close Firefox by closing the last article's tab, I don't want that article (which I've already read) to be restored when I restart Firefox.
Component: General → Session Restore
OS: Linux → All
QA Contact: general → session.restore
Hardware: x86 → All
Version: unspecified → Trunk
AFAICT there's no longer any way to close the last open tab without obviously closing the window as well (at least the tab's close button has been removed), which would make this bug either INVALID or WONTFIX (if reworded as enhancement request to be able to close the last open tab).
Whiteboard: [invalid?]
I would like to second on this issue. It is acceptable for closing the last tab to close Firefox. However the closed tab should not be loaded the next time Firefox is started, but the users homepage instead.

If the last tab is explicitly closed (I use ctrl-w) It should not be retained for the next loading of the browser.
Blocks: cuts-cruft
I don't think the bug is invalid, but I could see "won't fix".

I get the behavior as described in the initial report, and I understand the point from the bug report.

When there is only one tab left (and the browser is set to exit when the last tab is closed), the tab menu (right-click on the tab) has "Close Tab" disabled and pressing "c" does nothing. This avoids the problem.

But there are still many ways to exit. Some are:

o menu/quit, Ctrl+Shift+W, Alt+F4 : These are exit or close window and should save the tabs for the next Firefox start.

o Kill the process. This will save the session to be restored next time.

o Ctrl-W, Ctrl-F4 : These are Close Tab. For consistency with the tab menu they should be disabled. If they aren't disabled they should close the tab, then exit since Firefox has nothing to do. When Firefox restarts it should not restore that last tab.

While I think disabling control-w would be consistent, I think it would be more confusing to me than the current behavior (but then, my preference is to get a blank tab when I close the last open tab).
I believe this should be WONTFIX if it is indeed invalid.

Leaving the final call up to Paul.
Whiteboard: [invalid?] → [invalid?][session-store-testday]
This is a duplicate of #343876.
Sorry, bug 343876 is not really a duplicate. It seems that as Tyler wrote, Firefox 3.6 and later do not allow just closing the last tab, you need to close the window. That seems to cause this ambiguity on what should happen when you close the last tab. This bug appears to replace bug 343876, with the new tabs behavior.
I just realize that Chromium seems to do this correctly. If you have one window with one tab and close the window, the tab is reopened, however if you "just close the tab" (Ctrl+W or clicking on the tab's X icon), it is not reopened when relaunching.

It's arguable that even closing the window shouldn't bring back the window's tabs. Sometimes, you do close a window meaning to get rid of all its tabs because you're done with a certain activity. But we should probably first solve this then see how it feels...
I often see that problem, especially under Linux (I don't use MS-Windows as much). But, what looks really "funny" is when I restart FireFox (or SeaMonkey) and it asks me whether I want to open an empty tab. Yes. If you close all your tabs, and all that's left is an empty tab, then you close FireFox, on next restart, quite often, I get the Restore Session request with "Do you want to restart with an empty tab?"
(In reply to Alexis Wilke from comment #10)
> I often see that problem, especially under Linux (I don't use MS-Windows as
> much). But, what looks really "funny" is when I restart FireFox (or
> SeaMonkey) and it asks me whether I want to open an empty tab. Yes. If you
> close all your tabs, and all that's left is an empty tab, then you close
> FireFox, on next restart, quite often, I get the Restore Session request
> with "Do you want to restart with an empty tab?"

I'm sorry to say, that is expected behavior for Firefox. See the resolution of https://bugzilla.mozilla.org/show_bug.cgi?id=631882

No, I have no idea why about:blank is so complicated that it can't be restored.

It's 2019, and I still have this issue. :)

  1. Version

Firefox Quantum 67.0.4 (64-bit),
on NixOS 19.03 (VERSION="19.03.172979.8634c3b6199 (Koi)")

  1. Relevant options

browser.tabs.closeWindowWithLastTab: true (default)
browser.startup.page: 3 (modified)

  1. Steps to reproduce

A. Open Firefox
B. Navigate to https://bugzilla.mozilla.org/show_bug.cgi?id=490136
C. Close the tab with Ctrl-w
D. (Firefox exits)
E. Re-open Firefox

  1. Expected behavior

When I reopen Firefox, I expect to see my homepage (browser.startup.homepage)

  1. Actual behavior

When I reopen Firefox, I am taken to https://bugzilla.mozilla.org/show_bug.cgi?id=490136

By the way, the same problem exists if you replace step C with "Close the tab by clicking on the 'x' in the tab bar"

You need to log in before you can comment on or make changes to this bug.