WSL shell tab not closed on exit if last command executed had a non-zero exit code #6134

Closed
opened 2026-01-31 00:30:43 +00:00 by claunia · 2 comments
Owner

Originally created by @slieschke on GitHub (Jan 24, 2020).

Environment

Windows build number: 10.0.18363.592
Windows Terminal version (if applicable): 0.8.10091.0
No "closeOnExit" setting in my profile.

Steps to reproduce

  1. Open an WSL shell
  2. Run a command that results in a non-zero exit code
  3. Run exit

Expected behavior

The WSL shell tab closes

Actual behavior

The WSL shell tab remains open and it displays [process exited with code <exit code of previous command>].

image

Originally created by @slieschke on GitHub (Jan 24, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18363.592 Windows Terminal version (if applicable): 0.8.10091.0 No "closeOnExit" setting in my profile. ``` # Steps to reproduce 1. Open an WSL shell 1. Run a command that results in a non-zero exit code 1. Run `exit` # Expected behavior The WSL shell tab closes # Actual behavior The WSL shell tab remains open and it displays _[process exited with code \<exit code of previous command>]_. ![image](https://user-images.githubusercontent.com/742941/73108977-e20ee200-3ecf-11ea-9767-24aeb952cf81.png)
claunia added the Needs-TriageResolution-Duplicate labels 2026-01-31 00:30:44 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 24, 2020):

Far as we can tell, this is by design following the example of the ubuntu default terminal: https://github.com/microsoft/terminal/issues/4223#issuecomment-574834181

@DHowett-MSFT commented on GitHub (Jan 24, 2020): Far as we can tell, this is by design following the example of the ubuntu default terminal: https://github.com/microsoft/terminal/issues/4223#issuecomment-574834181
Author
Owner

@slieschke commented on GitHub (Jan 24, 2020):

Thanks @DHowett for the explanation. I've added "closeOnExit": "always" as you mentioned at https://github.com/microsoft/terminal/issues/4223#issuecomment-574774501 and that's a good enough workaround for me.

@slieschke commented on GitHub (Jan 24, 2020): Thanks @DHowett for the explanation. I've added `"closeOnExit": "always"` as you mentioned at https://github.com/microsoft/terminal/issues/4223#issuecomment-574774501 and that's a good enough workaround for me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6134