microsoft / microsoft/terminal

PowerShell argument `WindowStyle -Hidden` is not respected when the default terminal application is Windows Terminal

Open
#12,464 32 comments 17 reactions 0 assignees View on GitHub
Area-DefApp Issue-Feature Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.12.10393.0

### Windows build number

Microsoft Windows NT 10.0.22549.0

### Other Software

|Software | Version|
|---| --- |
| PowerShell.exe | Multiple Versions |
| pwsh.exe | Multiple Versions |

### Steps to reproduce

1. Set Windows Terminal as the default terminal application:
.
![image](https://user-images.githubusercontent.com/6994498/153515763-9362bbc3-2c4f-4a8e-8927-804ec3b7c7af.png)

2. Make sure to save changes to Windows Terminal Settings, and then using Windows Run, run `pwsh -WindowStyle Hidden -Command Sleep 10`:
![image](https://user-images.githubusercontent.com/6994498/153516667-363724b3-1400-47ae-aa39-333a74b287d0.png)

### Expected Behavior

A new PowerShell process launches (Windows Terminal), and it isn't visible. The window _may_ flash for a second. PowerShell window shouldn't be displayed when it's launched with `WindowStyle -Hidden`.

### Actual Behavior

A new PowerShell process launches (on Windows Terminal), and it is visible and remains visible (and waits) for 10 seconds.

![image](https://user-images.githubusercontent.com/6994498/153516951-e0feb19c-7bf3-4660-a1ba-9195a8034540.png)

Note: There is no repro for this issue with `Windows Console Host` as the default terminal application.

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior with Windows Terminal set as the default terminal and run `pwsh -WindowStyle Hidden -Command Sleep 10`, comparing it with Windows Console Host. Trace the Windows Terminal handling of PowerShell process launch and window visibility; done means the hidden launch remains invisible while the existing console-host behavior is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.