microsoft / microsoft/terminal
Terminal Preview Hanging On Startup
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
### Windows Terminal version
1.23.10353.0
### Windows build number
22631.4890
### Other Software
_No response_
### Steps to reproduce
I don't know what is causing it. For me it happens right now any time I try to open the terminal in any way at all.
### Expected Behavior
The terminal opens and does not peg a CPU core.
### Actual Behavior
As of today, my Windows Terminal Preview build has started hanging on every startup, spinning the CPU. I also noticed similar behavior with Terminal Canary starting several months ago, so I had to switch to Preview which was working at the time... But now Preview also has the same behavior...

I am now debugging it with windbg, and it seems this thread has the highest usage:

If we let it run and randomly break now and then we see a similar stack trace every time with a call to TerminalApp!Pane::LayoutSizeNode::operator=



That leaves me to believe this is some kind of endless loop somewhere within this call trace.
I have `firstWindowPreference": "persistedWindowLayout"` enabled in my config. Here is redacted version of my `state.json` file:
```json
{
"dismissedMessages" :
[
"deprecated",
"closeOnExitInfo"
],
"generatedProfiles" :
[
"{REDACTED}",
"{REDACTED}",
"{REDACTED}",
"{REDACTED}"
],
"persistedWindowLayouts" :
[
{
"initialPosition" : "0,-14",
"initialSize" :
{
"height" : 880.4444580078125,
"width" : 1536
},
"launchMode" : "maximized",
"tabLayout" :
[
{
"action" : "newTab",
"commandline" : "REDACTED",
"profile" : "REDACTED",
"sessionId" : "{REDACTED}",
"startingDirectory" : "REDACTED",
"suppressApplicationTitle" : false,
"tabTitle" : "REDACTED"
},
{
"action" : "splitPane",
"commandline" : "REDACTED",
"profile" : "REDACTED",
"sessionId" : "{REDACTED}",
"size" : 0.5,
"split" : "right",
"splitMode" : "manual",
"startingDirectory" : "REDACTED",
"suppressApplicationTitle" : false,
"tabTitle" : "REDACTED"
},
{
"action" : "splitPane",
"commandline" : "REDACTED",
"profile" : "REDACTED",
"sessionId" : "{REDACTED}",
"size" : 0.5,
"split" : "down",
"splitMode" : "manual",
"startingDirectory" : "REDACTED",
"suppressApplicationTitle" : false,
"tabTitle" : "REDACTED"
},
{
"action" : "focusPane",
"id" : 0
},
"togglePaneZoom",
{
"action" : "newTab",
"commandline" : "REDACTED",
"profile" : "REDACTED",
"sessionId" : "{REDACTED}",
"startingDirectory" : "REDACTED",
"suppressApplicationTitle" : false,
"tabTitle" : "REDACTED"
},
{
"action" : "switchToTab",
"index" : 0
}
]
}
],
"recentCommands" :
[
"ls"
],
"settingsHash" : "REDACTED"
}
```
Contributor guide
Research direction
The report points to TerminalApp::Pane::LayoutSizeNode::operator= and a persistedWindowLayouts entry in state.json. Start by reproducing startup with firstWindowPreference set to persistedWindowLayout and inspecting the reported call trace. Done means Preview starts without pegging a CPU core for this configuration, with the regression verified appropriately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, desktop, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100