Stop closing terminal after a commandline arg program ends #13122

Closed
opened 2026-01-31 03:34:25 +00:00 by claunia · 5 comments
Owner

Originally created by @RaSan147 on GitHub (Mar 20, 2021).

Description of the new feature/enhancement

I'm running WT 1.6.10571.0 . I was trying the command line args to open a python program. When i ran this wt.exe py D:\Pythons\asd.py the WT opened with the desired python program as expected. However when the program ended, I was expecting that the terminal will keep on and i can do other stuffs there.
But unfortunately the terminal closed. Tried using with new tab arg, different profiles, different terminal args. Still it produced same result. Anything you can do with this?

Proposed technical implementation details (optional)

Originally created by @RaSan147 on GitHub (Mar 20, 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'm running WT 1.6.10571.0 . I was trying the command line args to open a python program. When i ran this `wt.exe py D:\Pythons\asd.py` the WT opened with the desired python program as expected. However when the program ended, I was expecting that the terminal will keep on and i can do other stuffs there. But unfortunately the terminal closed. Tried using with new tab arg, different profiles, different terminal args. Still it produced same result. Anything you can do with this? # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 03:34:25 +00:00
Author
Owner

@DHowett commented on GitHub (Mar 20, 2021):

You can configure the termination behavior with the closeOnExit setting. The never setting will stop Terminal from exiting, even when a process has signalled successful completion.

@DHowett commented on GitHub (Mar 20, 2021): You can configure the termination behavior with the `closeOnExit` setting. The `never` setting will stop Terminal from exiting, _even when a process has signalled successful completion_.
Author
Owner

@vefatica commented on GitHub (Mar 21, 2021):

Will any setting leave OpenConsole.exe running and allow starting a new shell (effectively replacing the old one)? ... as happens, for example, with CMD, running in a console, if you issue

start /b & exit

or powershell with

start -NoNewWindow powershell ; exit

@vefatica commented on GitHub (Mar 21, 2021): Will any setting leave OpenConsole.exe running and allow starting a new shell (effectively replacing the old one)? ... as happens, for example, with CMD, running in a console, if you issue `start /b & exit` or powershell with `start -NoNewWindow powershell ; exit`
Author
Owner

@DHowett commented on GitHub (Mar 21, 2021):

No, and leaving OpenConsole running wouldn’t be the right way to do that. That’s the ConPTY host, it does not have any process management capabilities anyway.

Terminal is somewhat different from conhost in this regard: it tracks the root process, and terminates the session if that root process exits.

@DHowett commented on GitHub (Mar 21, 2021): No, and leaving OpenConsole running wouldn’t be the right way to do that. That’s the ConPTY host, it does not have any process management capabilities anyway. Terminal is somewhat different from conhost in this regard: it tracks the root process, and terminates the session if that root process exits.
Author
Owner

@vefatica commented on GitHub (Mar 21, 2021):

Does conhost actually have process management capabilities? I (naively) figured it just hung around as long as someone had open handles to its I/O.

@vefatica commented on GitHub (Mar 21, 2021): Does conhost actually have process management capabilities? I (naively) figured it just hung around as long as someone had open handles to its I/O.
Author
Owner

@DHowett commented on GitHub (Mar 21, 2021):

Sort-of. If you launch conhost directly from the Run dialog, it will spawn a connected client.

@DHowett commented on GitHub (Mar 21, 2021): Sort-of. If you launch conhost directly from the Run dialog, it will spawn a connected client.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13122