Skip to content

macOS: fix intrinsicContentSize race in windowDidLoad#11322

Merged
mitchellh merged 2 commits intoghostty-org:mainfrom
bo2themax:fix-intrisincSize
Mar 10, 2026
Merged

macOS: fix intrinsicContentSize race in windowDidLoad#11322
mitchellh merged 2 commits intoghostty-org:mainfrom
bo2themax:fix-intrisincSize

Conversation

@bo2themax
Copy link
Member

This should fix #11256 and #11271.

Tested manually with various combination of window-width/height and macos-titlebar-style.

Screen.Recording.2026-03-10.at.15.58.01.mp4

AI Disclosure

All the commits are generated by Claude, but orchestrated and manually tested by myself.

bo2themax and others added 2 commits March 10, 2026 15:27
…g#11256)

Tests that validate intrinsicContentSize returns a correct value when
TerminalController.windowDidLoad() reads it. Currently fail, proving
the race condition where @focusedvalue hasn't propagated
lastFocusedSurface before the 40ms timer fires.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
)

Add initialContentSize fallback on TerminalViewContainer so
intrinsicContentSize returns the correct value immediately,
without waiting for @focusedvalue to propagate. This removes
the need for the DispatchQueue.main.asyncAfter 40ms delay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bo2themax bo2themax requested a review from a team as a code owner March 10, 2026 15:22
@mitchellh mitchellh added this to the 1.3.1 milestone Mar 10, 2026
@mitchellh mitchellh merged commit 85f0972 into ghostty-org:main Mar 10, 2026
123 of 125 checks passed
@bo2themax bo2themax deleted the fix-intrisincSize branch March 10, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extremely small window size when setting macos-titlebar-style to native on tip version of ghostty

2 participants