exit command doesn't close the window\tab #7036

Closed
opened 2026-01-31 00:53:25 +00:00 by claunia · 7 comments
Owner

Originally created by @fcingolani88 on GitHub (Mar 20, 2020).

Windows build number: 10.0.18363.720
Windows Terminal version (if applicable): 0.10.761.0

Steps to reproduce

Type "EXIT" command after the shell reports an error about the previous command

Expected behavior

The window\tab should be closed

Actual behavior

The window\tab stays open and I can't type anything. The exit code displayed changes on different cases, maybe is related to the error reported before.

Note that this seems to happen only when the previous command terminates with an error; if the previous command is performed correctly, the EXIT command will work as expected.

image

image

Thanks

Originally created by @fcingolani88 on GitHub (Mar 20, 2020). Windows build number: 10.0.18363.720 Windows Terminal version (if applicable): 0.10.761.0 # Steps to reproduce Type "EXIT" command after the shell reports an error about the previous command # Expected behavior The window\tab should be closed # Actual behavior The window\tab stays open and I can't type anything. The exit code displayed changes on different cases, maybe is related to the error reported before. Note that this seems to happen only when the previous command terminates with an error; if the previous command is performed correctly, the EXIT command will work as expected. ![image](https://user-images.githubusercontent.com/47388994/77177531-f46b5d80-6ac5-11ea-8e2c-5ede42e426eb.png) ![image](https://user-images.githubusercontent.com/47388994/77178257-1b765f00-6ac7-11ea-82a7-17ce2f4a8136.png) Thanks
claunia added the Resolution-Duplicate label 2026-01-31 00:53:25 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 20, 2020):

Alas, this is a behavior that's highly conserved across multiple shells and terminal emulators on most mainstream operating systems; more info in https://github.com/microsoft/terminal/issues/4223#issuecomment-574834181. If you'd rather it just exit every time, set closeOnExit to true. 😄 /dup #4223.

@DHowett-MSFT commented on GitHub (Mar 20, 2020): Alas, this is a behavior that's highly conserved across multiple shells and terminal emulators on most mainstream operating systems; more info in https://github.com/microsoft/terminal/issues/4223#issuecomment-574834181. If you'd rather it just exit every time, set `closeOnExit` to true. :smile: /dup #4223.
Author
Owner

@ghost commented on GitHub (Mar 20, 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 (Mar 20, 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!
Author
Owner

@fcingolani88 commented on GitHub (Mar 20, 2020):

ok, but I already have closeOnExit to true. I think by default

@fcingolani88 commented on GitHub (Mar 20, 2020): ok, but I already have `closeOnExit` to true. I think by default
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 20, 2020):

@fcingolani88 would you mind sharing a copy of your profiles.json file?

@DHowett-MSFT commented on GitHub (Mar 20, 2020): @fcingolani88 would you mind sharing a copy of your profiles.json file?
Author
Owner

@fcingolani88 commented on GitHub (Mar 20, 2020):

Sure, here you are
profiles.zip

@fcingolani88 commented on GitHub (Mar 20, 2020): Sure, here you are [profiles.zip](https://github.com/microsoft/terminal/files/4360528/profiles.zip)
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 20, 2020):

Oh, thanks! I realized my guidance is incorrect. When we changed how closeOnExit worked, we introduced some new values: "graceful", "never" and "always'. We made it so that true was the same as "graceful" (which is the behavior you're seeing.)

You'll need to set it to "always" to make sure it actually exits.

As an aside, it looks like you're using a very old version of our settings file. If you're willing to change it, now would be a great time to start over as described in Scott Hanselman's blog. If you're using older settings like those that bind Ctrl+T and Ctrl+W to new and close tab, you might need to update your new settings file with those options. Otherwise, it's a much better experience. 😄

@DHowett-MSFT commented on GitHub (Mar 20, 2020): Oh, thanks! I realized my guidance is incorrect. When we changed how `closeOnExit` worked, we introduced some new values: `"graceful"`, `"never`" and `"always'`. We made it so that `true` was the same as `"graceful`" (which is the behavior you're seeing.) You'll need to set it to `"always"` to make sure it actually exits. As an aside, it looks like you're using a very old version of our settings file. If you're willing to change it, now would be a great time to [start over](https://hanselman.com/blog/NowIsTheTimeToMakeAFreshNewWindowsTerminalProfilesjson.aspx) as described in Scott Hanselman's blog. If you're using older settings like those that bind <kbd>Ctrl+T</kbd> and <kbd>Ctrl+W</kbd> to new and close tab, you might need to update your new settings file with those options. Otherwise, it's a _much_ better experience. :smile:
Author
Owner

@fcingolani88 commented on GitHub (Mar 23, 2020):

Perfect!!
Thank you, also for Scott Hanselman's info

@fcingolani88 commented on GitHub (Mar 23, 2020): Perfect!! Thank you, also for Scott Hanselman's info
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7036