Make exit code behavior more disacoverable #14694

Closed
opened 2026-01-31 04:17:06 +00:00 by claunia · 10 comments
Owner

Originally created by @superm1 on GitHub (Jul 26, 2021).

Description of the new feature/enhancement

When a process exits with a return code while closing a terminal, the following message shows up (assuming exit 130)

[process exited with code 130]

It's difficult to know what this means, especially if it's while closing a pane. If a process returns an exit code that is non zero, I can't figure out how to get rid of that pane now. Example:
image

This inevitably leads eventually to https://github.com/microsoft/terminal/issues/5214

Proposed technical implementation details (optional)

Add a clearer message why this happened, and how to change it.

Process exited with code 130, to adjust what happens with non-zero exit codes visit Settings->Foo->bar

Then in the GUI add a new option that will control adding

"closeOnExit": "always"
Originally created by @superm1 on GitHub (Jul 26, 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 When a process exits with a return code while closing a terminal, the following message shows up (assuming exit 130) ``` [process exited with code 130] ``` It's difficult to know what this means, especially if it's while closing a pane. If a process returns an exit code that is non zero, I can't figure out how to get rid of that pane now. Example: ![image](https://user-images.githubusercontent.com/494526/127058330-e5de5f43-7fb2-45f9-b812-79722ce383ed.png) <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> This inevitably leads eventually to https://github.com/microsoft/terminal/issues/5214 # Proposed technical implementation details (optional) Add a clearer message why this happened, and how to change it. ``` Process exited with code 130, to adjust what happens with non-zero exit codes visit Settings->Foo->bar ``` Then in the GUI add a new option that will control adding ``` "closeOnExit": "always" ``` <!-- A clear and concise description of what you want to happen. -->
Author
Owner

@skyline75489 commented on GitHub (Jul 27, 2021):

Add a clearer message why this happened, and how to change it.

Cool idea :) /cc @cinnamon-msft

Then in the GUI add a new option that will control adding

This exists already.

@skyline75489 commented on GitHub (Jul 27, 2021): >Add a clearer message why this happened, and how to change it. Cool idea :) /cc @cinnamon-msft > Then in the GUI add a new option that will control adding This exists already.
Author
Owner

@superm1 commented on GitHub (Jul 27, 2021):

This exists already.

TIL. It's on a per-OS-profile basis.

@superm1 commented on GitHub (Jul 27, 2021): > > This exists already. TIL. It's on a per-OS-profile basis.
Author
Owner

@zadjii-msft commented on GitHub (Aug 2, 2021):

I'm okay with adding something like

to adjust what happens with non-zero exit codes visit Settings->Foo->bar. Read more at <link-to-the-docs....>

But only in the scenario where it's only displayed the first time it happens, because otherwise I feel like it just adds noise. Fortunately, with #8324, we can actually do this. Thanks for the idea!

@zadjii-msft commented on GitHub (Aug 2, 2021): I'm okay with adding something like > to adjust what happens with non-zero exit codes visit Settings->Foo->bar. Read more at \<link-to-the-docs....\> But only in the scenario where it's only displayed the first time it happens, because otherwise I feel like it just adds noise. Fortunately, with #8324, we can actually do this. Thanks for the idea!
Author
Owner

@Toxic-Waste- commented on GitHub (Aug 6, 2021):

it's this by design? I have ran into this issue aswell, I use terminal to connect to multiple servers, and especially when I want to close a pane I split before to check something extra, I want the pane to close when I exit the session.

Now it seems to be stuck and I can't get my screenspace back. I also have no way of closing that pane without closing the entire tab, that can't be by design?

Example (obfuscated IP and username information for obvious reasons):
pane not closing

Or should I create a seperate issue for this?

Edit: I am an idiot, you can close it with the keybinding obviously, but it would be nice if it closed by design when you exit an SSH session for example :)

@Toxic-Waste- commented on GitHub (Aug 6, 2021): it's this by design? I have ran into this issue aswell, I use terminal to connect to multiple servers, and especially when I want to close a pane I split before to check something extra, I want the pane to close when I exit the session. Now it seems to be stuck and I can't get my screenspace back. I also have no way of closing that pane without closing the entire tab, that can't be by design? Example (obfuscated IP and username information for obvious reasons): ![pane not closing](https://user-images.githubusercontent.com/11042823/128485720-9b436171-e860-4d97-819b-8e01c51c2fd2.png) Or should I create a seperate issue for this? Edit: I am an idiot, you can close it with the keybinding obviously, but it would be nice if it closed by design when you exit an SSH session for example :)
Author
Owner

@DHowett commented on GitHub (Aug 6, 2021):

would be nice if it closed by design when you exit an SSH session for example :)

Definitely! That's why we made this configurable with the closeOnExit key (or the profile setting about what to do when the connected application exits! It's in the Advanced tab on the profile page.)

@DHowett commented on GitHub (Aug 6, 2021): > would be nice if it closed by design when you exit an SSH session for example :) Definitely! That's why we made this configurable with the `closeOnExit` key (or the profile setting about what to do when the connected application exits! It's in the Advanced tab on the profile page.)
Author
Owner

@Don-Vito commented on GitHub (Sep 2, 2021):

I'm okay with adding something like

to adjust what happens with non-zero exit codes visit Settings->Foo->bar. Read more at <link-to-the-docs....>

But only in the scenario where it's only displayed the first time it happens, because otherwise I feel like it just adds noise. Fortunately, with #8324, we can actually do this. Thanks for the idea!

@zadjii-msft - how do you envision the UX of this. I believe it should be an InfoBar with "Don't show this message again" button rather then printing some text into the terminal.

Probably something like:
image

@Don-Vito commented on GitHub (Sep 2, 2021): > > I'm okay with adding something like > > > to adjust what happens with non-zero exit codes visit Settings->Foo->bar. Read more at <link-to-the-docs....> > > But only in the scenario where it's only displayed the first time it happens, because otherwise I feel like it just adds noise. Fortunately, with #8324, we can actually do this. Thanks for the idea! @zadjii-msft - how do you envision the UX of this. I believe it should be an InfoBar with "Don't show this message again" button rather then printing some text into the terminal. Probably something like: ![image](https://user-images.githubusercontent.com/4639110/131923839-e02bb3ac-5e7f-4252-ab49-5c4b1b6bf041.png)
Author
Owner

@ghost commented on GitHub (Oct 20, 2021):

:tada:This issue was addressed in #11139, which has now been successfully released as Windows Terminal v1.11.2921.0.🎉

Handy links:

@ghost commented on GitHub (Oct 20, 2021): :tada:This issue was addressed in #11139, which has now been successfully released as `Windows Terminal v1.11.2921.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.11.2921.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Oct 20, 2021):

:tada:This issue was addressed in #11139, which has now been successfully released as Windows Terminal Preview v1.12.2922.0.🎉

Handy links:

@ghost commented on GitHub (Oct 20, 2021): :tada:This issue was addressed in #11139, which has now been successfully released as `Windows Terminal Preview v1.12.2922.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.12.2922.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Oct 25, 2021):

Today, I got the CloseOnExitInfoBar for the first time. I then pressed Ctrl+Shift+W to close the tab, but the info bar remained there.

Should the info bar be local to the tab or even to the pane? I suppose it shouldn't, because KeyboardServiceWarningInfoBar and SetAsDefaultInfoBar aren't local either, and because the info bar shows up on nonzero exit codes even if Windows Terminal has already been configured to close the tab regardless.

If the info bar is not local to the tab, then its location between the tab bar (when the title bar is hidden) and the terminal panes feels misleading. Should it instead be above the tab bar or below the terminal panes?

How can I close the info bar by using the keyboard?

@KalleOlaviNiemitalo commented on GitHub (Oct 25, 2021): Today, I got the CloseOnExitInfoBar for the first time. I then pressed Ctrl+Shift+W to close the tab, but the info bar remained there. Should the info bar be local to the tab or even to the pane? I suppose it shouldn't, because KeyboardServiceWarningInfoBar and SetAsDefaultInfoBar aren't local either, and because the info bar shows up on nonzero exit codes even if Windows Terminal has already been configured to close the tab regardless. If the info bar is not local to the tab, then its location between the tab bar (when the title bar is hidden) and the terminal panes feels misleading. Should it instead be above the tab bar or below the terminal panes? How can I close the info bar by using the keyboard?
Author
Owner

@zadjii-msft commented on GitHub (Oct 25, 2021):

because the info bar shows up on nonzero exit codes even if Windows Terminal has already been configured to close the tab regardless.

well that's not what you want. I'll file that.

If the info bar is not local to the tab, then its location between the tab bar (when the title bar is hidden) and the terminal panes feels misleading. Should it instead be above the tab bar or below the terminal panes?

You're... not wrong here. It's maybe not the best place for it, but on top of the tabs would look insane, and probably wouldn't even work easily, given the way we reparent the tab row into the titlebar.

In the pane itself would make more sense, but that runs abreast of all sorts of things like #9024, #4998, which might make more sense.

I then pressed Ctrl+Shift+W to close the tab, but the info bar remained there.

That, that we could probably fix.

@zadjii-msft commented on GitHub (Oct 25, 2021): > because the info bar shows up on nonzero exit codes even if Windows Terminal has already been configured to close the tab regardless. well that's not what you want. I'll file that. > If the info bar is not local to the tab, then its location between the tab bar (when the title bar is hidden) and the terminal panes feels misleading. Should it instead be above the tab bar or below the terminal panes? You're... not wrong here. It's maybe not the best place for it, but _on top_ of the tabs would look insane, and probably wouldn't even work easily, given the way we reparent the tab row into the titlebar. In the pane itself would make more sense, but that runs abreast of all sorts of things like #9024, #4998, which might make more sense. > I then pressed Ctrl+Shift+W to close the tab, but the info bar remained there. That, that we could probably fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14694