Window is restored after each computer unlocking #20430

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

Originally created by @ygoe on GitHub (Aug 30, 2023).

Windows Terminal version

1.17.11461.0

Windows build number

10.0.22621.0

Other Software

No response

Steps to reproduce

  1. Enable the setting "New instance behaviour": "Add to most recently opened window on this desktop"
  2. Open a terminal window
  3. Minimise it
  4. Lock the computer
  5. Unlock the computer

Expected Behavior

The minimised window doesn't move and stays where it is, minimised.

Actual Behavior

The Terminal window is now restored and visible on my screen after unlocking. Every time.

I suspect the mentioned setting has something to do with it. I could only observe this after setting it. I did this to reduce the number of windows for multiple long-running background console applications. Other than that, it's a normal and fresh Windows 11 setup with all hardware drivers, including AMD.

I also suspected a scheduled task to be run as console application after locking or unlocking the computer. That might explain why the Terminal window gets restored. After disabling all of them the behaviour remains though. So even if it's caused by this or not, the behaviour is still undesired. The Terminal must be able to remember and keep its window state unless the user interacts with it.

Originally created by @ygoe on GitHub (Aug 30, 2023). ### Windows Terminal version 1.17.11461.0 ### Windows build number 10.0.22621.0 ### Other Software _No response_ ### Steps to reproduce 1. Enable the setting "New instance behaviour": "Add to most recently opened window on this desktop" 2. Open a terminal window 3. Minimise it 4. Lock the computer 5. Unlock the computer ### Expected Behavior The minimised window doesn't move and stays where it is, minimised. ### Actual Behavior The Terminal window is now restored and visible on my screen after unlocking. Every time. I suspect the mentioned setting has something to do with it. I could only observe this after setting it. I did this to reduce the number of windows for multiple long-running background console applications. Other than that, it's a normal and fresh Windows 11 setup with all hardware drivers, including AMD. I also suspected a scheduled task to be run as console application after locking or unlocking the computer. That might explain why the Terminal window gets restored. After disabling all of them the behaviour remains though. So even if it's caused by this or not, the behaviour is still undesired. The Terminal must be able to remember and keep its window state unless the user interacts with it.
claunia added the Resolution-By-DesignNeeds-TriageIssue-Bug labels 2026-01-31 07:13:38 +00:00
Author
Owner

@DHowett commented on GitHub (Aug 30, 2023):

I have seen the AMD driver software attempting to spawn a console window on login or wake from sleep. I do not know whether it uses a scheduled task.

Unfortunately, this is not something we can ultimately control: if we provide a setting that suppresses all console application foreground requests, we will invariably encounter users who turn it on and are then deeply confused or concerned that they don't get console windows any longer. (I say this because we get reports of "terminal not having a title bar," which is only possible when you intentionally and explicitly enable something called focus mode, which is documented as doing exactly that :P)

There is no way for us to determine that a given console application is not, in fact, trying to be in the foreground.

Oh wait, there is. It's just that a bunch of driver developers choose not to use it! 😆

Alas.

Thanks for filing this!

@DHowett commented on GitHub (Aug 30, 2023): I have seen the AMD driver software attempting to spawn a console window on login or wake from sleep. I do not know whether it uses a scheduled task. Unfortunately, this is not something we can ultimately control: if we provide a setting that suppresses all console application foreground requests, we will _invariably_ encounter users who turn it on and are then deeply confused or concerned that they don't get console windows any longer. (I say this because we get reports of "terminal not having a title bar," which is only possible when you intentionally and explicitly enable something called focus mode, which is documented as doing exactly that :P) There is no way for us to determine that a given console application is _not,_ in fact, trying to be in the foreground. Oh wait, there is. It's just that a bunch of driver developers choose not to use it! 😆 Alas. Thanks for filing this!
Author
Owner

@ygoe commented on GitHub (Aug 30, 2023):

@DHowett I could think of a solution that is under your control. If a new tab caused the window to restore, and that tab closes again, then re-minimise the window. Problem solved.

On the title bar, well, my terminal didn't have a title bar until I manually enabled it again. I can't stand windows without a title bar. Unfortunately, the title bar is slowly dying. But keyboard accessibility seems to be removed from Windows 11 in general. It gets harder with every Windows version to recognise the active window. (In Windows 10 you had to enable title bar colours, in Windows 11 the taskbar buttons have almost zero contrast.) Until the concept will eventually go away and keyboard input will simply land anywhere unpredictably. Nobody cares. 😞

@ygoe commented on GitHub (Aug 30, 2023): @DHowett I could think of a solution that *is* under your control. If a new tab caused the window to restore, and that tab closes again, then re-minimise the window. Problem solved. On the title bar, well, my terminal didn't have a title bar until I manually enabled it again. I can't stand windows without a title bar. Unfortunately, the title bar is slowly dying. But keyboard accessibility seems to be removed from Windows 11 in general. It gets harder with every Windows version to recognise the active window. (In Windows 10 you had to enable title bar colours, in Windows 11 the taskbar buttons have almost zero contrast.) Until the concept will eventually go away and keyboard input will simply land anywhere unpredictably. Nobody cares. 😞
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20430