Tabs leak GDI handles on tab title resizes #8198

Open
opened 2026-01-31 01:23:12 +00:00 by claunia · 0 comments
Owner

Originally created by @RealDolos on GitHub (May 17, 2020).

Originally assigned to: @miniksa on GitHub.

Environment

Windows build number: 10.0.18363.0
Windows Terminal version (if applicable): 0.11.1333.0

Steps to reproduce

  1. In the preferences, set "tabWidthMode": "titleLength" or any other configuration that allows for variably-sized tab titles (to trigger this bug)
  2. Run the following in a powershell tab (or anything similar in any type of tab) to trigger lots of tab title resizes
for ($i=0;;++$i) { $host.UI.RawUI.WindowTitle = "oops " + @(Get-Random -Minimum 0.0 -Maximum 100000000.3) + @(Get-Random) + @(Get-Random) + " oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooops"; }

Expected behavior

Windows Terminal should keep running, keep updating the tab title, without leaking GDI handles.

Actual behavior

Windows Terminal keeps allocating new GDI handles (as seen in Task Manager/ProcessHacker) and will eventually crash and just vanish.

The leaked GDI handles will be retained even when the corresponding tab is closed

term resource ex

Please note

It is not enough to just update the title when tabs are in equal mode/are not resized.

Originally created by @RealDolos on GitHub (May 17, 2020). Originally assigned to: @miniksa on GitHub. # Environment ```none Windows build number: 10.0.18363.0 Windows Terminal version (if applicable): 0.11.1333.0 ``` # Steps to reproduce 1. In the preferences, set `"tabWidthMode": "titleLength"` or any other configuration that allows for variably-sized tab titles (to trigger this bug) 2. Run the following in a powershell tab (or anything similar in any type of tab) to trigger lots of tab title resizes ```powershell for ($i=0;;++$i) { $host.UI.RawUI.WindowTitle = "oops " + @(Get-Random -Minimum 0.0 -Maximum 100000000.3) + @(Get-Random) + @(Get-Random) + " oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooops"; } ``` # Expected behavior Windows Terminal should keep running, keep updating the tab title, without leaking GDI handles. # Actual behavior Windows Terminal keeps allocating new GDI handles (as seen in Task Manager/ProcessHacker) and will eventually crash and just vanish. The leaked GDI handles will be retained even when the corresponding tab is closed ![term resource ex](https://user-images.githubusercontent.com/9981466/82151292-1c273980-985b-11ea-9c3f-82612b135f37.png) # Please note It is *not* enough to just update the title when tabs are in `equal` mode/are not resized.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8198