Can we exit terminal completely when command exit is called? #15142

Closed
opened 2026-01-31 04:29:41 +00:00 by claunia · 5 comments
Owner

Originally created by @amithegde on GitHub (Sep 8, 2021).

Description of the new feature/enhancement

I usually enter command exit to exit cmd.exe or conemu which exits the process. But with terminal, it displays:

image

Now, need to grab mouse and click the close button to close it completely. Interestingly, when I have quake mode, there is no x button to close it so I need to take help from trusted friend Process Explorer to kill Terminal.

Note: this happens for the first tab, splits and other tabs seem to exit fine.

Proposed technical implementation details (optional)

  • When user enters the command exit terminal process should exit completely
Originally created by @amithegde on GitHub (Sep 8, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement I usually enter command `exit` to exit cmd.exe or conemu which exits the process. But with terminal, it displays: ![image](https://user-images.githubusercontent.com/816051/132563484-b54d59b4-e8b7-45a3-b8c6-1fef76b4e2ac.png) Now, need to grab mouse and click the close button to close it completely. Interestingly, when I have quake mode, there is no `x` button to close it so I need to take help from trusted friend `Process Explorer` to kill Terminal. Note: this happens for the first tab, splits and other tabs seem to exit fine. # Proposed technical implementation details (optional) - When user enters the command `exit` terminal process should exit completely
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 04:29:41 +00:00
Author
Owner

@DHowett commented on GitHub (Sep 8, 2021):

(You can also close it with Ctrl+Shift+W.)

Over to @zadjii-msft for his cached response 😄

@DHowett commented on GitHub (Sep 8, 2021): (You can also close it with <kbd>Ctrl+Shift+W</kbd>.) Over to @zadjii-msft for his cached response :smile:
Author
Owner

@elsaco commented on GitHub (Sep 9, 2021):

By default "Profile termination behavior" in "Advanced" settings is "Close only when process exits successfully". By selecting first option "Close when process exits, fails, or crashes" will close a cmd.exe session without the [process exited with code 1] message.

Sample config:
wt_cmd_exit_setting

@elsaco commented on GitHub (Sep 9, 2021): By default "Profile termination behavior" in "Advanced" settings is "Close only when process exits successfully". By selecting first option "Close when process exits, fails, or crashes" will close a cmd.exe session without the [process exited with code 1] message. Sample config: ![wt_cmd_exit_setting](https://user-images.githubusercontent.com/3933920/132601625-d6a9fce7-ab5a-41fa-bc92-4d37830854d4.png)
Author
Owner

@LuanVSO commented on GitHub (Sep 9, 2021):

type this isntead:

exit 0
@LuanVSO commented on GitHub (Sep 9, 2021): type this isntead: ```cmd exit 0 ```
Author
Owner

@zadjii-msft commented on GitHub (Sep 9, 2021):

Thanks for the report! Please make sure to search for duplicates when filing new issues. There's already a decent amount of discussion in the above issues explaining why this happens.

https://github.com/microsoft/terminal/issues/4263#issuecomment-670164469

This behavior exists to stop an error message printed out by a program from disappearing instantly when it exits. There is a class of applications for which that is extremely important. We're following this behavior because it is the right brhavior to follow, and because you can turn it off with a config option very easily.

https://github.com/microsoft/terminal/issues/4736#issuecomment-592127830

Alas, this is a behavior that's highly conserved across multiple shells and terminal emulators on most mainstream operating systems; more info in #4223 (comment). If you'd rather it just exit every time, set closeOnExit to true. 😄 /dup #4223.

And of course, as mentioned elsewhere in this thread, the closeOnExit setting can change this behavior if you're really used to using exit to close your terminal windows. You can read more about it in the docs here.

@zadjii-msft commented on GitHub (Sep 9, 2021): Thanks for the report! Please make sure to [search for duplicates](https://github.com/microsoft/terminal/issues?q=is%3Aissue+%22process+exited+with+code+9009%22+is%3Aclosed) when filing new issues. There's already a decent amount of discussion in the above issues explaining why this happens. https://github.com/microsoft/terminal/issues/4263#issuecomment-670164469 > This behavior exists to stop an error message printed out by a program from _disappearing instantly_ when it exits. There is a class of applications for which that is extremely important. We're following this behavior because it is the right brhavior to follow, _and because you can turn it off with a config option very easily._ https://github.com/microsoft/terminal/issues/4736#issuecomment-592127830 > Alas, this is a behavior that's highly conserved across multiple shells and terminal emulators on most mainstream operating systems; more info in [#4223 (comment)](https://github.com/microsoft/terminal/issues/4223#issuecomment-574834181). If you'd rather it just exit every time, set `closeOnExit` to true. 😄 /dup #4223. And of course, as mentioned elsewhere in this thread, the `closeOnExit` setting can change this behavior if you're really used to using `exit` to close your terminal windows. You can read more about it in [the docs here](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/profile-advanced#profile-termination-behavior).
Author
Owner

@ghost commented on GitHub (Sep 9, 2021):

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 (Sep 9, 2021): 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#15142