terminal: PowerShell argument `WindowStyle -Hidden` is not respected when the default terminal application is Windows Terminal
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
-
Set Windows Terminal as the default terminal application: .

-
Make sure to save changes to Windows Terminal Settings, and then using Windows Run, run
pwsh -WindowStyle Hidden -Command Sleep 10:
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.

Note: There is no repro for this issue with Windows Console Host as the default terminal application.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 7
- Comments: 22 (8 by maintainers)
Request: Since all
SW_HIDErelated-issues get closed as duplicates of this thread, perhaps change this issue title to something not so Powershell-specific?DHowett’s idea makes the most sense to me: Hide the tab, and I’m with KG-droid, if we wanted users to mess with the window, we’d minimize it.
Yeah, many thanks for that, i already use a C# app for hide console if needed, but… As of this is a Bug-Report (Issue Tracker) for “Windows Terminal” and the BUG still exists, it is not my point “how to workaround”, but thanks anyway!
It’s still bugged in “Windows Terminal” and so it is up to them to fix this in the Terminal Code! Especially as of this is a “Feature” used and working PROPERLY in the default Terminal but it is NOT in “Windows Terminal” and exactly THAT is the point of this Bug-Report!
You can Block me or set anything to Off-topic as often as you want… But this will NOT fix the (1+ Year old) Bug, it still exists and is not working with
powershell.exenor is it onpwsh.exe, that is REALITY not not a problem with Powershell at all!Yeah… Maybe it’s time to prioritize Fixing existing Bugs instead of creating new ones. 🤣
The changelog Windows Terminal Preview v1.17.1023 does not contain any Fix for THIS problem and the last non-Preview also does not of course, so… What is your point?
Most useful comment I’ve seems, thanks…👍
Error still exists 1 year after report… really? 👍
Hi DHowett When you say “That window can show up in the tray icon list of windows”, do you mean a user would be able to just click the icon in the tray/taskbar icons and re-open the hidden window? As ideally from a business point of view, you wouldn’t want users to be able to see and mess with hidden windows that easily, that are configuring things, as inevitably, some users would end up closing it, and then end up logging incidents because something is no longer working.
I’m gonna lock this thread for a bit to give everyone some time to relax. Obviously, this is still busted (at least, for Powershell 7
pwsh, though, it seems to work forpowershell.exe). You’ll note, there’s plenty of issues on this repo that are even older than this one. We do our best to fix as many issues as we can, but if this is one that you’re particularly passionate about, we’d love to hear suggestions on how to fix it. The Terminal (and PowerShell) are open-source after all ☺️@HenryBaby Marriage made in heaven.
@fuba82
Read the message I was replying to and you’ll have a chance to see the point. Instead of wasting my time reading your postings.
@youk not sure why that was directed towards @KG-droid, as it’s @fuba82 being childish.
Nonetheless, let’s not make this a pie-throwing contest 😃
Hey @zadjii-msft! Now that we merged tearoff plus #14944 and #13478, we might have the right underpinnings to let console applications “hide” their windows.
Mini-proposal (which should be fleshed out into a spec):
A console application that hides its window should be detached from the pane/tab it’s in and moved to a new tab in a hidden window. That window can show up in the tray icon list of windows, and users can show them if they want, but we won’t have to present UI for it. If that console app was already the only tenant in a window (no panes/tabs), we could just mark that one hidden.
NO it does not… The Terminal Window just “minimize” but is not “Hidden” as intended!
with the “default” console both of this work:
powershell -WindowStyle Hidden -Command Sleep 10ANDpwsh -WindowStyle Hidden -Command Sleep 10This is a blocker for many applications such as rush that use PowerShell to run background tasks. Rush issue tracked here.
The console window being shown for a second may still be tolerable but with WT the window isn’t hidden at all - there’s no difference between using the PowerShell argument
-WindowStyle Hiddenand not using this argument when WT is the default terminal application.