Confirm or Prevent Last Tab Close #6430

Closed
opened 2026-01-31 00:38:29 +00:00 by claunia · 10 comments
Owner

Originally created by @psylenced on GitHub (Feb 14, 2020).

Originally assigned to: @DHowett on GitHub.

Description of the new feature/enhancement

Sometimes when completing a session with multiple tabs open, a user may want to close everything but still keep a tab open.

There are two possible alternatives (when the option is true):

  1. When closing last tab, prevent it from closing.

  2. When closing last tab, present a confirm dialog.

When the option is false/default - last tab closes app as per current behaviour.

Proposed technical implementation details (optional)

Add confirmCloseLastTab or preventCloseLastTab to profile.json

Originally created by @psylenced on GitHub (Feb 14, 2020). Originally assigned to: @DHowett on GitHub. # Description of the new feature/enhancement Sometimes when completing a session with multiple tabs open, a user may want to close everything but still keep a tab open. There are two possible alternatives (when the option is true): 1) When closing last tab, prevent it from closing. 2) When closing last tab, present a confirm dialog. When the option is false/default - last tab closes app as per current behaviour. # Proposed technical implementation details (optional) Add `confirmCloseLastTab` or `preventCloseLastTab` to profile.json
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 14, 2020):

Thanks for the request.
Would this happen when the user closes almost all of the tabs, and then manually closes the last one? Would it happen when they click the [x] or press Alt+F4.. which would close all the tabs except for the last one?

Right now, the user must explicitly agree to close all tabs, or manually close the final tab themselves (because there's no other way to close tabs)... so I am a little confused 😄

@DHowett-MSFT commented on GitHub (Feb 14, 2020): Thanks for the request. Would this happen when the user closes almost all of the tabs, and then manually closes the last one? Would it happen when they click the `[x]` or press <kbd>Alt+F4</kbd>.. which would close all the tabs except for the last one? Right now, the user must explicitly agree to close _all_ tabs, or manually close the final tab themselves (because there's no other way to close tabs)... so I am a little confused :smile:
Author
Owner

@electronic-dk commented on GitHub (Feb 14, 2020):

What about an option for not closing the window when the last tab is closed? Same as Firefox's "closeWindowWithLastTab"?

Offtop: I've sent a similar feature request to MS Edge's team.

@electronic-dk commented on GitHub (Feb 14, 2020): What about an option for not closing the window when the last tab is closed? Same as Firefox's "closeWindowWithLastTab"? Offtop: I've sent a similar feature request to MS Edge's team.
Author
Owner

@ghost commented on GitHub (Feb 18, 2020):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Feb 18, 2020): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@psylenced commented on GitHub (Feb 18, 2020):

Thanks for the request.

As mentioned by @electronic-dk above, I was picturing this as similar to how browsers handle the process.

It usually takes effect from keyboard shortcuts to close tabs (Ctrl-W or similar). If you hold the shortcut down (or press the shortcuts in succession) you'll end up with an empty window or a default tab rather than the application closing.

It's basically a process to say I still want to do something, but I want to start fresh.

@psylenced commented on GitHub (Feb 18, 2020): > Thanks for the request. As mentioned by @electronic-dk above, I was picturing this as similar to how browsers handle the process. It usually takes effect from keyboard shortcuts to close tabs (Ctrl-W or similar). If you hold the shortcut down (or press the shortcuts in succession) you'll end up with an empty window or a default tab rather than the application closing. It's basically a process to say I still want to do something, but I want to start fresh.
Author
Owner

@zadjii-msft commented on GitHub (May 8, 2020):

Hey this is also related to #2976, I'm commenting here to make sure I don't lose that issue again

@zadjii-msft commented on GitHub (May 8, 2020): Hey this is also related to #2976, I'm commenting here to make sure I don't lose that issue again
Author
Owner

@stela2502 commented on GitHub (May 26, 2020):

I am using the terminal app together with the WLS and R.

If I am in a similar situation using Ubuntu the terminal asks if I close a tab that contains a running process. If I have a resting tab with just the command prompt waiting for some input I can close the tab without any questions, but if I have an R or ssh session running I get the confirmation dialogue.

I think this would actually be the best way to make everybody kind of happy - right?

@stela2502 commented on GitHub (May 26, 2020): I am using the terminal app together with the WLS and R. If I am in a similar situation using Ubuntu the terminal asks if I close a tab that contains a running process. If I have a resting tab with just the command prompt waiting for some input I can close the tab without any questions, but if I have an R or ssh session running I get the confirmation dialogue. I think this would actually be the best way to make everybody kind of happy - right?
Author
Owner

@electronic-dk commented on GitHub (May 26, 2020):

@stela2502 while I think your suggestion is pretty useful (there might be a ticket for it actually, but I'm not sure), I think what OP meant was: "Avoid closing the entire terminal window when the last tab of the said window is closed".

@electronic-dk commented on GitHub (May 26, 2020): @stela2502 while I think your suggestion is pretty useful (there might be a ticket for it actually, but I'm not sure), I think what OP meant was: "Avoid closing the entire terminal window when the last tab of the said window is closed".
Author
Owner

@stela2502 commented on GitHub (May 27, 2020):

You are absolutely right, but from a usability point of view I would honestly just re-open an anyhow empty (all tabs are closed) terminal. The other functionality is really a pain in the ass if it is missing.

@stela2502 commented on GitHub (May 27, 2020): You are absolutely right, but from a usability point of view I would honestly just re-open an anyhow empty (all tabs are closed) terminal. The other functionality is really a pain in the ass if it is missing.
Author
Owner

@DHowett commented on GitHub (Jun 6, 2020):

/dup #6276 because it has more information/is a little clearer :)

@DHowett commented on GitHub (Jun 6, 2020): /dup #6276 because it has more information/is a little clearer :)
Author
Owner

@ghost commented on GitHub (Jun 6, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jun 6, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6430