Process exits prematurely #23637

Closed
opened 2026-01-31 08:47:52 +00:00 by claunia · 5 comments
Owner

Originally created by @mikaele90 on GitHub (Sep 22, 2025).

Windows Terminal version

1.22.12111.0

Windows build number

10.0.26100.0

Other Software

7z, 64-bit x64, 25.01

Steps to reproduce

When running for example "Get-ChildItem -Recurse -Filter *.rar | ForEach-Object { 7z x $_.FullName -o"$($_.DirectoryName)" -y }" on an HDD that's under load, the process seems to be interpreted as "exited" way before the loop is complete.

The archives were in the 5-7GB range.

With default settings I got only one successful extraction done out of 20.

After setting profile termination behavior to "Never close automatically" and allowed it to run in the background in installed apps as "Always", I got two successful extractions before it exited.

Expected Behavior

Turned all the knobs to what I'd imagine should work;

  • Enabled "Run this profile as Administrator"
  • Disabled "Automatically mark prompts on pressing Enter"
  • Disabled "Launch this application with a new environment block"

And... It worked. All extractions finished as they should have.

Either way, it seems like there might be a bug here. Perhaps induced by the slower response time of the HDD under existing load.

Actual Behavior

Process terminates prematurely.

Originally created by @mikaele90 on GitHub (Sep 22, 2025). ### Windows Terminal version 1.22.12111.0 ### Windows build number 10.0.26100.0 ### Other Software 7z, 64-bit x64, 25.01 ### Steps to reproduce When running for example "`Get-ChildItem -Recurse -Filter *.rar | ForEach-Object { 7z x $_.FullName -o"$($_.DirectoryName)" -y }`" on an HDD that's under load, the process seems to be interpreted as "exited" way before the loop is complete. The archives were in the 5-7GB range. With default settings I got only one successful extraction done out of 20. After setting profile termination behavior to "Never close automatically" and allowed it to run in the background in installed apps as "Always", I got two successful extractions before it exited. ### Expected Behavior Turned all the knobs to what I'd imagine should work; - Enabled "Run this profile as Administrator" - Disabled "Automatically mark prompts on pressing Enter" - Disabled "Launch this application with a new environment block" And... It worked. All extractions finished as they should have. Either way, it seems like there might be a bug here. Perhaps induced by the slower response time of the HDD under existing load. ### Actual Behavior Process terminates prematurely.
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 08:47:52 +00:00
Author
Owner

@DHowett commented on GitHub (Sep 22, 2025):

Is it Terminal which is exiting, PowerShell or 7-zip? Or, perhaps, OpenConsole (our console hosting process)? Do you have any event viewer logs about the four of these?

FWIW, the "never close ..." setting should always leave you with an open window with an error code in it. If it leaves you with no window, that's Terminal exiting or crashing. It should do neither in this case.

All of the "close on exit" settings only take effect when the process hosted within Terminal has exited on its own. We never ourselves time out a process or manage its lifetime in any way other than starting it.

@DHowett commented on GitHub (Sep 22, 2025): Is it _Terminal_ which is exiting, PowerShell or 7-zip? Or, perhaps, OpenConsole (our console hosting process)? Do you have any event viewer logs about the four of these? FWIW, the "never close ..." setting should always leave you with an open window with an error code in it. If it leaves you with no window, that's Terminal exiting or crashing. It should do neither in this case. All of the "close on exit" settings only take effect when the process hosted within Terminal has exited on its own. We never _ourselves_ time out a process or manage its lifetime in any way other than starting it.
Author
Owner

@mikaele90 commented on GitHub (Sep 23, 2025):

Turns out that the terminal had to be launched as an administrator to have the entire process complete successfully. The weird part really is how sometimes it got two archives extracted instead of just one (as I was writing this I got one run to 3 archives completed). My guess is 7z is the culprit, even though I've had random terminations of terminal windows running powershell in the last few days (instances that have only just been launched less than a minute ago, with nothing running yet).

Right now the terminal just leaves this code and message for me, when a process does not finish successfully:
[process exited with code 1 (0x00000001)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

Nothing obvious in the event viewer, but I also might not be looking in the right place to find the correct logs.

Sorry, if this is wasting your time. At this point I doubt Terminal itself is the culprit, might be either 7z or powershell. Unfortunately I don't know enough about OpenConsole to diagnose problems with it, if there are any.

Edit: Right after typing this I got one of those instances, where a process terminates, without me having done anything yet. Basically just:
PS N:\launch-location>
[process exited with code 1 (0x00000001)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

@mikaele90 commented on GitHub (Sep 23, 2025): Turns out that the terminal had to be launched as an administrator to have the entire process complete successfully. The weird part really is how sometimes it got two archives extracted instead of just one (as I was writing this I got one run to 3 archives completed). My guess is 7z is the culprit, even though I've had random terminations of terminal windows running powershell in the last few days (instances that have only just been launched less than a minute ago, with nothing running yet). Right now the terminal just leaves this code and message for me, when a process does not finish successfully: _[process exited with code 1 (0x00000001)] You can now close this terminal with Ctrl+D, or press Enter to restart._ Nothing obvious in the event viewer, but I also might not be looking in the right place to find the correct logs. Sorry, if this is wasting your time. At this point I doubt Terminal itself is the culprit, might be either 7z or powershell. Unfortunately I don't know enough about OpenConsole to diagnose problems with it, if there are any. Edit: Right after typing this I got one of those instances, where a process terminates, without me having done anything yet. Basically just: _PS N:\launch-location> [process exited with code 1 (0x00000001)] You can now close this terminal with Ctrl+D, or press Enter to restart._
Author
Owner

@DHowett commented on GitHub (Oct 15, 2025):

Thanks for following up! We're still stumped and don't think it's on our end, but I do think there's some tracing we can do to get closer to a root cause...

Would you be able to follow the steps at https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#capturing-a-debug-etl-trace and get it to happen again?

If you were to run PowerShell without Terminal (by running conhost powershell (or conhost pwsh if that is your persuasion) or by changing your default terminal app back to "Windows Console Host"), does it happen? Over there it would manifest as the window closing with little additional ceremony.

@DHowett commented on GitHub (Oct 15, 2025): Thanks for following up! We're still stumped and don't think it's on our end, but I do think there's some tracing we can do to get closer to a root cause... Would you be able to follow the steps at https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#capturing-a-debug-etl-trace and get it to happen again? If you were to run PowerShell _without_ Terminal (by running `conhost powershell` (or `conhost pwsh` if that is your persuasion) or by changing your default terminal app back to "Windows Console Host"), does it happen? Over there it would manifest as the window closing with little additional ceremony.
Author
Owner

@mikaele90 commented on GitHub (Oct 15, 2025):

Unfortunately, I already did a fresh install of Windows (not because of this), which unsurprisingly solved the issue. I think this issue can be closed, but I'll be sure to follow the steps in the guide and report back if the issue ever returns.

@mikaele90 commented on GitHub (Oct 15, 2025): Unfortunately, I already did a fresh install of Windows (not because of this), which unsurprisingly solved the issue. I think this issue can be closed, but I'll be sure to follow the steps in the guide and report back if the issue ever returns.
Author
Owner

@lhecker commented on GitHub (Oct 16, 2025):

I'll be closing this issue for now then.

@lhecker commented on GitHub (Oct 16, 2025): I'll be closing this issue for now then.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23637