Windows Terminal does not close when ran via Scheduled Tasks #20781

Closed
opened 2026-01-31 07:23:54 +00:00 by claunia · 2 comments
Owner

Originally created by @danielniccoli on GitHub (Nov 8, 2023).

Windows Terminal version

1.18.2822.0

Windows build number

10.0.19045.0

Other Software

No response

Steps to reproduce

Create a scheduled task that runs a ps1 file with pwsh.exe -f ....

image

With a daily trigger like so

image

Expected Behavior

The script should run and after it is finished, the Microsoft Terminal should be closed.

Actual Behavior

Microsoft Terminal stays open. It has no active tab and the window is transparent.

image

It cannot be closed via the X. Instead, you must click the + to add any new tab and then you can close the terminal via the X.

The bug does not appear consistently, but very often.

Originally created by @danielniccoli on GitHub (Nov 8, 2023). ### Windows Terminal version 1.18.2822.0 ### Windows build number 10.0.19045.0 ### Other Software _No response_ ### Steps to reproduce Create a scheduled task that runs a `ps1` file with `pwsh.exe -f ....` ![image](https://github.com/microsoft/terminal/assets/2971735/bf22ad42-d5df-4d27-ad86-226f041ad0d3) With a daily trigger like so ![image](https://github.com/microsoft/terminal/assets/2971735/b6245203-461c-49cb-8bf4-6976d63071c0) ### Expected Behavior The script should run and after it is finished, the Microsoft Terminal should be closed. ### Actual Behavior Microsoft Terminal stays open. It has no active tab and the window is transparent. ![image](https://github.com/microsoft/terminal/assets/2971735/ccfa4381-d03f-43f7-a95e-2b7210ecbd78) It cannot be closed via the X. Instead, you must click the + to add any new tab and then you can close the terminal via the X. The bug does not appear consistently, but very often.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 07:23:54 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Nov 8, 2023):

I think this is more or less #15936. I'm betting your script spawns and exits real fast, SO fast that the Terminal doesn't even have the time to open a real tab for it. That thread has more details.

/dup #15936

@zadjii-msft commented on GitHub (Nov 8, 2023): I think this is more or less #15936. I'm betting your script spawns and exits real fast, SO fast that the Terminal doesn't even have the time to open a real tab for it. That thread has more details. /dup #15936
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Nov 8, 2023):

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!

@microsoft-github-policy-service[bot] commented on GitHub (Nov 8, 2023): 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! <!-- Policy app identification https://img.shields.io/static/v1?label=PullRequestIssueManagement. -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20781