Quake window responds poorly to SW_MINIMIZE coming through ConPTY #23120

Open
opened 2026-01-31 08:32:59 +00:00 by claunia · 14 comments
Owner

Originally created by @arqalite on GitHub (Apr 8, 2025).

Windows Terminal version

1.22.10731.0

Windows build number

10.0.19044.0

Other Software

No response

Steps to reproduce

Start Windows Terminal with the following command: wt.exe -w _quake pwsh -window minimized

Expected Behavior

The Terminal opens in Quake mode, then minimizes itself. No other windows appear on the screen.

Actual Behavior

The Terminal does open in Quake mode, minimized. But then there is a very small (presumably empty) window in the bottom-left corner of the screen.

Image

This happens on both Windows 10 Enterprise LTSC and Windows 11 Pro. My assumption is that Terminal needs this window to exist, but it's supposed to be outside the screen boundary?

Originally created by @arqalite on GitHub (Apr 8, 2025). ### Windows Terminal version 1.22.10731.0 ### Windows build number 10.0.19044.0 ### Other Software _No response_ ### Steps to reproduce Start Windows Terminal with the following command: `wt.exe -w _quake pwsh -window minimized` ### Expected Behavior The Terminal opens in Quake mode, then minimizes itself. No other windows appear on the screen. ### Actual Behavior The Terminal does open in Quake mode, minimized. But then there is a very small (presumably empty) window in the bottom-left corner of the screen. ![Image](https://github.com/user-attachments/assets/a05dd5f1-24ee-4587-a5d3-5d419c8f2902) This happens on both Windows 10 Enterprise LTSC and Windows 11 Pro. My assumption is that Terminal needs this window to exist, but it's supposed to be outside the screen boundary?
claunia added the Issue-BugPriority-3Product-TerminalArea-Windowing labels 2026-01-31 08:33:00 +00:00
Author
Owner

@DHowett commented on GitHub (Apr 9, 2025):

Are you by chance using any shell modifications/?

@DHowett commented on GitHub (Apr 9, 2025): Are you by chance using any shell modifications/?
Author
Owner

@arqalite commented on GitHub (Apr 13, 2025):

I do not have any shell modifications on either device, as far as I can tell. That said, this does not occur with CMD, so I tried reinstalling PowerShell but the window still appears.

Running PowerShell in Console Host doesn't trigger this, so I'm unsure if it's a PowerShell issue or a Terminal issue.

@arqalite commented on GitHub (Apr 13, 2025): I do not have any shell modifications on either device, as far as I can tell. That said, this does not occur with CMD, so I tried reinstalling PowerShell but the window still appears. Running PowerShell in Console Host doesn't trigger this, so I'm unsure if it's a PowerShell issue or a Terminal issue.
Author
Owner

@DoGauss commented on GitHub (May 31, 2025):

I'm experiencing this, too. Though I'm starting wt from task scheduler on login.
I'm using
%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe -w _quake pwsh -nologo -window minimized -NoExit -Command "& { . $env:OneDrive\Dokumente\PowerShell\profile.ps1 }"
to launch.

If I have the quake mode window visible and then single click the grey area then something like a program's system menu pops up in the top left corner of my desktop - it'S the same menu I get when I right click in the free space of the wt tab bar

Image
If the quake mode window is not visible and I single click the grey area the nothing seems to happen.
If I double click it, then the quake mode windows opens and the grey area vanishes.
I can the hide the quake mode window with the key binding of my choice

This behaviour was not always so. In one of the older releases this grey area wasn't there - or if it was it was outside the visible desktop area. That should have been about 6 to 9 months ago

I do experience this behaviour on my own pc as well as my office pc so I guess I can reproduce the issue

@DoGauss commented on GitHub (May 31, 2025): I'm experiencing this, too. Though I'm starting wt from task scheduler on login. I'm using `%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe -w _quake pwsh -nologo -window minimized -NoExit -Command "& { . $env:OneDrive\Dokumente\PowerShell\profile.ps1 }"` to launch. If I have the quake mode window visible and then single click the grey area then something like a program's system menu pops up in the top left corner of my desktop - it'S the same menu I get when I right click in the free space of the wt tab bar ![Image](https://github.com/user-attachments/assets/5cd2240d-c9ef-44f9-ab16-f5fb22293bd4) If the quake mode window is not visible and I single click the grey area the nothing seems to happen. If I double click it, then the quake mode windows opens and the grey area vanishes. I can the hide the quake mode window with the key binding of my choice This behaviour was not always so. In one of the older releases this grey area wasn't there - or if it was it was outside the visible desktop area. That should have been about 6 to 9 months ago I do experience this behaviour on my own pc as well as my office pc so I guess I can reproduce the issue
Author
Owner

@DHowett commented on GitHub (Jun 4, 2025):

A-ha!

Image

So, PowerShell is minimizing its "console window," and we don't take kindly to that. We probably should.

In the meantime, if you remove -windowstyle minimized from your pwsh command line and instead set it in task scheduler itself:

Image

does that work?

... if not, how about -windowstyle hidden?

@DHowett commented on GitHub (Jun 4, 2025): A-ha! ![Image](https://github.com/user-attachments/assets/07420795-0c08-4a1c-88ef-d7dd35805eac) So, PowerShell is minimizing its "console window," and we don't take kindly to that. We probably should. In the meantime, if you remove `-windowstyle minimized` from your `pwsh` command line and instead set it in task scheduler itself: ![Image](https://github.com/user-attachments/assets/77ed489c-216c-4bd7-8fb8-1e7251203119) does that work? ... if not, how about `-windowstyle hidden`?
Author
Owner

@DoGauss commented on GitHub (Jun 5, 2025):

My observations:

  • The task option "hidden" doesn't work
  • "-windowstyle hidden" does work if I supply it as argument to pwsh like
    wt -w _quake pwsh -nologo -windowstyle hidden -NoExit

That doesn't allow me to use my wt profiles - neither implicitly the default profile nor explicitly any other
wt -w _quake -p "my profile" -windowstyle hidden
That expectetly throws an error as "-windowstyle hidden" is a parameter to pwsh and not to wt:

Image

My ultimate goal is to start my (default) profile in quake mode at startup and have that initially hidden so I have quick assess to it with the hotkeys I bound

@DoGauss commented on GitHub (Jun 5, 2025): My observations: - The task option "hidden" doesn't work - "-windowstyle hidden" does work if I supply it as argument to pwsh like `wt -w _quake pwsh -nologo -windowstyle hidden -NoExit` That doesn't allow me to use my wt profiles - neither implicitly the default profile nor explicitly any other `wt -w _quake -p "my profile" -windowstyle hidden` That expectetly throws an error as "-windowstyle hidden" is a parameter to pwsh and not to wt: ![Image](https://github.com/user-attachments/assets/e5e73488-04cb-427f-b6e8-f7a66427f2cc) My ultimate goal is to start my (default) profile in quake mode at startup and have that initially hidden so I have quick assess to it with the hotkeys I bound
Author
Owner

@DHowett commented on GitHub (Jun 5, 2025):

Perhaps this?

wt -w _quake -p "my profile" --appendCommandLine -- -WindowStyle Hidden

It's a mouthful, but it works over here.

@DHowett commented on GitHub (Jun 5, 2025): Perhaps this? ``` wt -w _quake -p "my profile" --appendCommandLine -- -WindowStyle Hidden ``` It's a mouthful, but it works over here.
Author
Owner

@DoGauss commented on GitHub (Jun 6, 2025):

Not much luck over here. If I do it this way I do get a running terminal - but it is CMD not pwsh.
It looks like an instance of CMD was dynamically generated from my default settings, and windowsstyle got completely ignored.
My actual profile I tried to invoke should have been a pwsh based profile.
My literal invocation is
wt -w _quake -p "PS7-Stable ITCO" --appendCommandLine -- -WindowStyle Hidden
There's no difference betwenn running from WIN+R and running from task scheduler

This profile is defined as
{ "backgroundImage": "%OneDriveConsumer%\\Bilder\\web\\rudi_outline.png", "commandline": "C:\\Program Files\\PowerShell\\7\\pwsh.exe", "cursorShape": "vintage", "guid": "{2aef55bd-f481-4f60-8b21-58c0b5cd857b}", "hidden": false, "icon": "%OneDriveConsumer%\\Bilder\\Icons\\256\\rudi_outline.png", "name": "PS7-stable ITCO" }

whereas my defaults are
{ "antialiasingMode": "aliased", "backgroundImage": "%OneDriveConsumer%\\Bilder\\web\\terminal-256.png", "backgroundImageAlignment": "bottomRight", "backgroundImageOpacity": 0.1, "backgroundImageStretchMode": "none", "closeOnExit": "automatic", "colorScheme": "Tango Dark", "cursorColor": "#FFFFFF", "cursorShape": "bar", "experimental.retroTerminalEffect": false, "font": { "face": "FiraCode Nerd Font", "size": 10 }, "historySize": 20000, "opacity": 75, "padding": "0, 0, 0, 0", "snapOnInput": true, "startingDirectory": "C:\\repos", "useAcrylic": true }

Am I missing something?
I'll be AKF for a few days. I'll get back in touch afterwards.

@DoGauss commented on GitHub (Jun 6, 2025): Not much luck over here. If I do it this way I do get a running terminal - but it is CMD not pwsh. It looks like an instance of CMD was dynamically generated from my default settings, and windowsstyle got completely ignored. My actual profile I tried to invoke should have been a pwsh based profile. My literal invocation is `wt -w _quake -p "PS7-Stable ITCO" --appendCommandLine -- -WindowStyle Hidden` There's no difference betwenn running from `WIN+R` and running from task scheduler This profile is defined as `{ "backgroundImage": "%OneDriveConsumer%\\Bilder\\web\\rudi_outline.png", "commandline": "C:\\Program Files\\PowerShell\\7\\pwsh.exe", "cursorShape": "vintage", "guid": "{2aef55bd-f481-4f60-8b21-58c0b5cd857b}", "hidden": false, "icon": "%OneDriveConsumer%\\Bilder\\Icons\\256\\rudi_outline.png", "name": "PS7-stable ITCO" }` whereas my defaults are `{ "antialiasingMode": "aliased", "backgroundImage": "%OneDriveConsumer%\\Bilder\\web\\terminal-256.png", "backgroundImageAlignment": "bottomRight", "backgroundImageOpacity": 0.1, "backgroundImageStretchMode": "none", "closeOnExit": "automatic", "colorScheme": "Tango Dark", "cursorColor": "#FFFFFF", "cursorShape": "bar", "experimental.retroTerminalEffect": false, "font": { "face": "FiraCode Nerd Font", "size": 10 }, "historySize": 20000, "opacity": 75, "padding": "0, 0, 0, 0", "snapOnInput": true, "startingDirectory": "C:\\repos", "useAcrylic": true }` Am I missing something? I'll be AKF for a few days. I'll get back in touch afterwards.
Author
Owner

@arqalite commented on GitHub (Jun 6, 2025):

Perhaps this?

wt -w _quake -p "my profile" --appendCommandLine -- -WindowStyle Hidden

It's a mouthful, but it works over here.

Can confirm this works on my machine.

I used the stock PowerShell 7.5.1 profile so my command was wt -w _quake -p "PowerShell" --appendCommandLine -- -WindowStyle Hidden.

@arqalite commented on GitHub (Jun 6, 2025): > Perhaps this? > > ``` > wt -w _quake -p "my profile" --appendCommandLine -- -WindowStyle Hidden > ``` > > It's a mouthful, but it works over here. Can confirm this works on my machine. I used the stock PowerShell 7.5.1 profile so my command was `wt -w _quake -p "PowerShell" --appendCommandLine -- -WindowStyle Hidden`.
Author
Owner

@Vallek commented on GitHub (Jun 7, 2025):

The one that works for me:

To start powershell: wt.exe --window "_quake" powershell -window hidden

To start cmd (opens it kinda in powershell tab): wt.exe --window "_quake" powershell -window hidden cmd

This way it doesn't spawn minimized window bug. Also works through autostart shortcut.

@Vallek commented on GitHub (Jun 7, 2025): The one that works for me: To start powershell: `wt.exe --window "_quake" powershell -window hidden` To start cmd (opens it kinda in powershell tab): `wt.exe --window "_quake" powershell -window hidden cmd` This way it doesn't spawn minimized window bug. Also works through autostart shortcut.
Author
Owner

@DoGauss commented on GitHub (Jun 19, 2025):

Antonio's comment about using a stock profile gave me something to think about.
The stock profile is basically just this:
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "hidden": true, "name": "PowerShell", "source": "Windows.Terminal.PowershellCore"
As Antonio found this does work as I want it to.

It still should work when using the commandline parameter but doesn't
I'm somewhat dependent on that as I have almost 20 profiles tailored to my various use cases. The source parameter and the default GUIDs are insuficient for most of my profiles

@DoGauss commented on GitHub (Jun 19, 2025): Antonio's comment about using a stock profile gave me something to think about. The stock profile is basically just this: `"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "hidden": true, "name": "PowerShell", "source": "Windows.Terminal.PowershellCore"` As Antonio found this does work as I want it to. It still should work when using the commandline parameter but doesn't I'm somewhat dependent on that as I have almost 20 profiles tailored to my various use cases. The source parameter and the default GUIDs are insuficient for most of my profiles
Author
Owner

@DHowett commented on GitHub (Jun 19, 2025):

So, this is one place where the settings UI makes it easier to handle. You don't want to replace the source (that's how Terminal knows that this profile was auto-detected, and where it came from!) but rather to get the existing commandline and append to it.

Image

If you open up the settings page, you can see exactly what it's set to and update it there.

@DHowett commented on GitHub (Jun 19, 2025): So, this is one place where the settings UI makes it easier to handle. You don't want to _replace_ the `source` (that's how Terminal knows that this profile was auto-detected, and where it came from!) but rather to get the existing `commandline` and append to it. ![Image](https://github.com/user-attachments/assets/5868984e-69e5-412c-9e3d-2f40d3298cc3) If you open up the settings page, you can see exactly what it's set to and update it there.
Author
Owner

@DoGauss commented on GitHub (Jun 19, 2025):

I was about to write a lengthy reply and report what I experienced in the last two hours of testing when I apparently stumbled over the solution: The value following wt -w _quake -p is case sensitive.

For whatever reason my profile was named
PS7-stable ITCO
whereas I used
PS7-Stable ITCO
as value to the profile parameter when invoking wt
Don't know if this is a historic discrepancy, a mishap, a typo, ... on my part but the correctly cased s/S did the trick.
Retrospectively the strings are extractly show that way in my last post on June 6th.

Can anyone independently verify this?

Regarding the case sensitivity nothing is mentioned here https://learn.microsoft.com/en-us/windows/terminal/command-line-arguments
@DHowett If my finging is correct, can you update the documentation on that site to spare everybody else this potential trap?

@DoGauss commented on GitHub (Jun 19, 2025): I was about to write a lengthy reply and report what I experienced in the last two hours of testing when I apparently stumbled over the solution: The value following `wt -w _quake -p ` is case sensitive. For whatever reason my profile was named `PS7-stable ITCO` whereas I used `PS7-Stable ITCO` as value to the profile parameter when invoking wt Don't know if this is a historic discrepancy, a mishap, a typo, ... on my part but the correctly cased s/S did the trick. Retrospectively the strings are extractly show that way in my last post on June 6th. Can anyone independently verify this? Regarding the case sensitivity nothing is mentioned here https://learn.microsoft.com/en-us/windows/terminal/command-line-arguments @DHowett If my finging is correct, can you update the documentation on that site to spare everybody else this potential trap?
Author
Owner

@DHowett commented on GitHub (Jun 19, 2025):

Argh! I even tested that!

I just realized that my test failed to reproduce the failure because it chose my default profile when it couldn't find all-lowercase powershell, and PowerShell when it found PowerShell.

It just so happens that my default profile is ... PowerShell. 🤦🏻

@DHowett commented on GitHub (Jun 19, 2025): _Argh!_ I even tested that! I just realized that my test failed to reproduce the failure because it chose my default profile when it couldn't find all-lowercase `powershell`, and PowerShell when it found `PowerShell`. It just so happens that my default profile is ... `PowerShell`. 🤦🏻
Author
Owner

@DoGauss commented on GitHub (Jul 2, 2025):

@DHowett with the correct and case-sensitive spelling of the profile I'm quite happy how it now works as I want it to. One question came up though:
This https://learn.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=windows
doesn't have all the command line arguments there are. At least this is missing:
--appendCommandLine --

Is there more documentation I can read?

@DoGauss commented on GitHub (Jul 2, 2025): @DHowett with the correct and case-sensitive spelling of the profile I'm quite happy how it now works as I want it to. One question came up though: This https://learn.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=windows doesn't have all the command line arguments there are. At least this is missing: `--appendCommandLine --` Is there more documentation I can read?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23120