Skip to content

Fix Windows terminal chrome density at high DPI - #941

Merged
coneilen merged 5 commits into
mainfrom
coneilen-fix-terminal-chrome-density
Oct 28, 2026
Merged

coneilen merged 5 commits into
mainfrom
coneilen-fix-terminal-chrome-density

Conversation

@coneilen

@coneilen coneilen commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes paired-review finding F2 by applying the macOS terminal chrome measurements as logical dimensions throughout the Windows physical-pixel workspace. The DPI192 live gate now distinguishes the bounded visible tab roster from the mounted tab topology instead of treating a hidden overflow tab as absent.

Changes

  • Scale the 37-logical strip, 25-logical tab pills, 22-logical pane headers, 24-by-22-logical split/New Tab controls, close targets, fonts, glyphs, radii, and hairlines exactly once at the workspace DPI boundary.
  • Preserve terminal surface allocation below 59 logical pixels of tab/pane chrome, DPI-aware UIA and pointer bounds, close guards, stable selection/focus roles, and overflow windows.
  • Keep 11 visible tabs at a 1440-logical client and admit all twelve minimum-width tabs at the Mac-observed 1508-logical width.
  • Record physical and DPI-normalized logical tab dimensions in matched capture observations.
  • Prove a DPI192 New Tab mounts both Goal and Shell even when the expanded detail panel permits only the selected Shell in the visible roster; collapse the panel before verifying both stable tab identities and both selection round trips.

Test plan

RED: & $env:GRAPHCODE_ZIG0152 test src\TerminalSurface.zig -target x86_64-windows-msvc -lc -luser32 -lkernel32 "-I$env:GRAPHCODE_WINGHOSTTY_ROOT\include" "$env:GRAPHCODE_WINGHOSTTY_ROOT\zig-out\lib\winghostty-win32-host.lib" zig-out\lib\ghostty-vt-static.lib -lgdi32 -lopengl32 -limm32 -lole32 -loleaut32 -luiautomationcore -lshell32 -ladvapi32 -lwinhttp --test-filter "workspace terminal chrome keeps mac logical density" -> failed: expected 50 physical pixels at DPI192, found 22
GREEN: same focused pinned-Zig command after the change -> 1/1 passed at 96, 144, and 192 DPI with 1440/1508 width contracts
REGRESSION: pwsh -NoProfile -File Tools\windows\validate.ps1 -Task windows-shell -ShellPart unit -ShellValidationRoot C:\v36 -> 60/60 registered sections passed; native accessibility provider 224 checks, 0 failures

  • TerminalSurface.zig full command -> 298/298 passed.
  • App.zig full command -> 1583 passed, 17 intentional skips, 0 failures.
  • Tools\windows\Tests\ValidationRunner.Tests.ps1 -> PASS; UiCaptureDriver 182/182.
  • pwsh -NoProfile -File Tools\windows\validate.ps1 -Task hardening -> deterministic fixtures passed on 3/3 repeated runs.
  • pwsh -NoProfile -File Tools\windows\validate.ps1 -Task windows-shell -ShellPart integration -ShellValidationRoot C:\v37 -SkipTrayLive -> F2 tab phase passed with overflowObserved=true, stable Goal/Shell IDs, and 50-physical/25-logical tab pills. Exact-head CI then reproduced a later worktree SelectionItem observer race. The follow-up binds the exact automation/runtime identity and rejects zero, duplicate, wrong-element, and stale-generation events; local live GREEN recorded UIA_SELECTION_EVENT_DECISION with count 1 and exact identities plus passing UIA_WORKTREE_SELECTION_EVIDENCE.
  • The larger chrome also exposed an early zmx endpoint-publication race: resize returned ConnectionRefused/FILE_NOT_FOUND for a newly attached 50x10 session. The final change retries that exact owned surface/session/rows/cols up to five times with a 100 ms delay, cancels owned controls on teardown, logs session/geometry/exit/stderr, and still surfaces exhaustion. Pinned zmx resize passed independently; the live gate no longer reported terminal PTY resize command failed and advanced through the Move-status phase to later unrelated UIA fixture work.
  • Authorized F2_TERMINAL_CHROME_FOCUSED_VALIDATION attempt on the exclusive PMv2 DPI192 desktop launched once from fresh C:\f6 and stopped before the first PNG because the focused wrapper did not include split/New Tab controls in its row query (Control roster differs for s-tabs-agent-unknown). The product, peer, and zmx processes cleaned to zero survivors. C:\f6\outputs\f2-focused-manifest.json SHA256 66EB0EB2614CA8608EBAB053E3214BA51FC6C724B3180E32727D5B8163D10B80; source ce92fe6970fa27f8a4da071e87fa21faeb84d904; binary SHA256 367E77D99F7CB8890D6D81EBAFC251D6C53B1313E2EC4B82D0DED3189FF105C5; images 0/11; privacy review had no images to inspect. No retry was authorized after launch, so the full focused scene matrix remains unproved.

Checklist

  • I have read the Contributing Guidelines
  • I have signed off my commits (git commit -s) per the DCO
  • Tests pass locally (make test)
  • Code follows the existing style (make check)
  • I added the test/contract before the implementation and observed the intended RED failure

coneilen and others added 5 commits October 27, 2026 14:29
Scale terminal tab, control, pane-header, text, and hit-target geometry from the macOS logical measurements while preserving overflow and terminal allocation contracts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Teach the live UIA gate to distinguish a mounted background tab from the bounded visible roster at DPI192, then verify stable Goal and Shell identities after exposing both tabs and switching each way.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Update the structural selector count for the new bounded overflow and collapsed-roster observations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Clear and reacquire the dynamic selection provider before subscribing, bind the exact automation and runtime identity, and reject zero, duplicate, foreign, or stale-generation events within the bounded wait.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Treat zmx endpoint publication refusal as a bounded startup race, preserve exact resize geometry across retries, cancel owned resize controls during teardown, and retain explicit exhausted-command diagnostics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
@coneilen
coneilen merged commit bae13e2 into main Oct 28, 2026
26 checks passed
@coneilen
coneilen deleted the coneilen-fix-terminal-chrome-density branch October 28, 2026 04:10
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.

1 participant