Feature Request: Customize confirmation prompt before exit. #4157

Open
opened 2026-01-30 23:39:37 +00:00 by claunia · 20 comments
Owner

Originally created by @gdevacc12 on GitHub (Sep 29, 2019).

Feature request: A confirmation prompt before terminal app exit.
For example, if there are multiple tabs open, upon initiation of exit a prompt to confirm or cancel exit.

Particularly with the case when multiple tabs open, prompting the user to think before closing multiple tabs may prevent a accidental loss of work/processing in tabs that are not in the foreground.

Perhaps make the prompt configurable in settings with the options:

  • disabled (no prompt before exit)
  • multiple (prompt if multiple tabs open)
  • always (prompt always before exit - for a check before closing even a single open tab)
  • #6641 add a "remember" checkbox
Originally created by @gdevacc12 on GitHub (Sep 29, 2019). Feature request: A confirmation prompt before terminal app exit. For example, if there are multiple tabs open, upon initiation of exit a prompt to confirm or cancel exit. Particularly with the case when multiple tabs open, prompting the user to think before closing multiple tabs may prevent a accidental loss of work/processing in tabs that are not in the foreground. Perhaps make the prompt configurable in settings with the options: - disabled (no prompt before exit) - multiple (prompt if multiple tabs open) - always (prompt always before exit - for a check before closing even a single open tab) * [ ] #6641 add a "remember" checkbox
claunia added the Help WantedIssue-TaskProduct-TerminalArea-UserInterface labels 2026-01-30 23:39:37 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 30, 2019):

We'll use this to track the work to connect #1589 to the close button.

@DHowett-MSFT commented on GitHub (Sep 30, 2019): We'll use this to track the work to connect #1589 to the close button.
Author
Owner

@dpopiashvili commented on GitHub (Jan 28, 2020):

Would be nice if it will be configurable per profile. I don't need confirmation when closing cmd tab, but might need one if I'm using SSH

@dpopiashvili commented on GitHub (Jan 28, 2020): Would be nice if it will be configurable per profile. I don't need confirmation when closing cmd tab, but might need one if I'm using SSH
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

@jroskey commented on GitHub (Jun 20, 2020):

New user here, and am loving the new Windows Terminal. In regards to the 'Prompt on close' Can there please be a 'Remember my answer' option to prevent it from coming up every time if we don't want it to? Or can this be done in the Setting .json file?

Thanks in advance!

@jroskey commented on GitHub (Jun 20, 2020): New user here, and am loving the new Windows Terminal. In regards to the 'Prompt on close' Can there please be a 'Remember my answer' option to prevent it from coming up every time if we don't want it to? Or can this be done in the Setting .json file? Thanks in advance!
Author
Owner

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

You can set confirmCloseOnExit to false. Check out the documentation! 😄

@DHowett commented on GitHub (Jun 20, 2020): You can set `confirmCloseOnExit` to `false`. Check out [the documentation](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/global-settings#hide-close-all-tabs-popup)! :smile:
Author
Owner

@jroskey commented on GitHub (Jun 20, 2020):

You can set confirmCloseOnExit to false. Check out the documentation! 😄

Thank you!!!!

@jroskey commented on GitHub (Jun 20, 2020): > You can set `confirmCloseOnExit` to `false`. Check out [the documentation](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/global-settings#hide-close-all-tabs-popup)! 😄 Thank you!!!!
Author
Owner

@ouweiya commented on GitHub (Jul 15, 2020):

This is now "confirmCloseAllTabs"

@ouweiya commented on GitHub (Jul 15, 2020): This is now "confirmCloseAllTabs"
Author
Owner

@jroskey commented on GitHub (Jul 15, 2020):

Works like a Charm, Thank you sir!

@jroskey commented on GitHub (Jul 15, 2020): Works like a Charm, Thank you sir!
Author
Owner

@fgimian commented on GitHub (Jul 19, 2020):

Is there a way to always confirm when closing (even with a single tab)? I just hit Alt+F4 by mistake on a Terminal window which was half way through a PowerShell script and wasn't prompted. I'm not sure if there's a way to detect a running action, but ideally it should never exit without prompt while a script or similar is running in the window imho.

Huge thanks
Fotis

@fgimian commented on GitHub (Jul 19, 2020): Is there a way to always confirm when closing (even with a single tab)? I just hit Alt+F4 by mistake on a Terminal window which was half way through a PowerShell script and wasn't prompted. I'm not sure if there's a way to detect a running action, but ideally it should never exit without prompt while a script or similar is running in the window imho. Huge thanks Fotis
Author
Owner

@Chips1234 commented on GitHub (Jul 28, 2020):

Is there a way to always confirm when closing (even with a single tab)? I just hit Alt+F4 by mistake on a Terminal window which was half way through a PowerShell script and wasn't prompted. I'm not sure if there's a way to detect a running action, but ideally it should never exit without prompt while a script or similar is running in the window imho.

Huge thanks

Fotis

@fgimian sorry for the late reply! I'm working on implementing it right now

@Chips1234 commented on GitHub (Jul 28, 2020): > Is there a way to always confirm when closing (even with a single tab)? I just hit Alt+F4 by mistake on a Terminal window which was half way through a PowerShell script and wasn't prompted. I'm not sure if there's a way to detect a running action, but ideally it should never exit without prompt while a script or similar is running in the window imho. > > > > Huge thanks > > Fotis @fgimian sorry for the late reply! I'm working on implementing it right now
Author
Owner

@fgimian commented on GitHub (Jul 28, 2020):

Is there a way to always confirm when closing (even with a single tab)? I just hit Alt+F4 by mistake on a Terminal window which was half way through a PowerShell script and wasn't prompted. I'm not sure if there's a way to detect a running action, but ideally it should never exit without prompt while a script or similar is running in the window imho.
Huge thanks
Fotis

@fgimian sorry for the late reply! I'm working on implementing it right now

Thank you so much! 😄

@fgimian commented on GitHub (Jul 28, 2020): > > Is there a way to always confirm when closing (even with a single tab)? I just hit Alt+F4 by mistake on a Terminal window which was half way through a PowerShell script and wasn't prompted. I'm not sure if there's a way to detect a running action, but ideally it should never exit without prompt while a script or similar is running in the window imho. > > Huge thanks > > Fotis > > @fgimian sorry for the late reply! I'm working on implementing it right now Thank you so much! 😄
Author
Owner

@Chips1234 commented on GitHub (Jul 28, 2020):

You’re welcome!

@Chips1234 commented on GitHub (Jul 28, 2020): You’re welcome!
Author
Owner

@mailinglists35 commented on GitHub (May 5, 2022):

ooops, I've closed a tab by mistake. not big work lost, but I was just an ENTER keypress away from starting a long script.
what is the status of this?

@mailinglists35 commented on GitHub (May 5, 2022): ooops, I've closed a tab by mistake. not big work lost, but I was just an ENTER keypress away from starting a long script. what is the status of this?
Author
Owner

@zadjii-msft commented on GitHub (May 5, 2022):

what is the status of this?

I've got about 50% of the spec written over in: https://github.com/microsoft/terminal/issues/6549#issuecomment-675494526. Just needs time to flush that out to a proper doc, and implement it.

@zadjii-msft commented on GitHub (May 5, 2022): > what is the status of this? I've got about 50% of the spec written over in: https://github.com/microsoft/terminal/issues/6549#issuecomment-675494526. Just needs time to flush that out to a proper doc, and implement it.
Author
Owner

@stiltet commented on GitHub (May 10, 2022):

The confirmCloseAllTabs is not enough. It needs to confirm also if only one tab but multiple windows in that tab is present. I just work and time now because it closes without confirmation... 😒

@stiltet commented on GitHub (May 10, 2022): The `confirmCloseAllTabs` is not enough. It needs to confirm also if only one tab but multiple windows in that tab is present. I just work and time now because it closes without confirmation... 😒
Author
Owner

@zadjii-msft commented on GitHub (May 10, 2022):

@stiltet Yep, that's all a part of https://github.com/microsoft/terminal/issues/6549#issuecomment-675494526

@zadjii-msft commented on GitHub (May 10, 2022): @stiltet Yep, that's all a part of https://github.com/microsoft/terminal/issues/6549#issuecomment-675494526
Author
Owner

@coopstah13 commented on GitHub (Jun 8, 2022):

How about hiding the close X except on the active tab? Typically the ones I accidentally close are not the tab I'm currently active in (because I'm trying to switch tabs). Perhaps if you hover long enough on the tab the X appears, but it seems like it would prevent a lot of accidents if you have to activate the tab first before you can close it.

@coopstah13 commented on GitHub (Jun 8, 2022): How about hiding the close X except on the active tab? Typically the ones I accidentally close are not the tab I'm currently active in (because I'm trying to switch tabs). Perhaps if you hover long enough on the tab the X appears, but it seems like it would prevent a lot of accidents if you have to activate the tab first before you can close it.
Author
Owner

@zadjii-msft commented on GitHub (Jun 8, 2022):

@coopstah13 That particular element we're tracking in #3335, namely, https://github.com/microsoft/terminal/issues/3335#issuecomment-1127502724

@zadjii-msft commented on GitHub (Jun 8, 2022): @coopstah13 That particular element we're tracking in #3335, namely, https://github.com/microsoft/terminal/issues/3335#issuecomment-1127502724
Author
Owner

@AkikoOrenji commented on GitHub (Sep 11, 2023):

is still still waiting deployment ? I just lost a bunch of work by hitting the x on a tab by mistake (no prompt if i meant it) :(

@AkikoOrenji commented on GitHub (Sep 11, 2023): is still still waiting deployment ? I just lost a bunch of work by hitting the x on a tab by mistake (no prompt if i meant it) :(
Author
Owner

@zadjii-msft commented on GitHub (Sep 11, 2023):

Yep. There still hasn't been any progress on formalizing https://github.com/microsoft/terminal/issues/6549#issuecomment-675494526 nor any work done to actually implement that yet.

@zadjii-msft commented on GitHub (Sep 11, 2023): Yep. There still hasn't been any progress on formalizing https://github.com/microsoft/terminal/issues/6549#issuecomment-675494526 nor any work done to actually implement that yet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4157