Conversation
Surface which pane has focus by dimming inactive splits with Ghostty's own unfocused-split overlay semantics. - WorktreeTerminalState exposes activeSurfaceID(for:) backed by the single focusedSurfaceIdByTab source of truth. Click-path and explicit focus paths (goto_split, split zoom, palette) both funnel through the new recordActiveSurface choke point so two panes can't both claim active and focus-loss can't wipe the remembered active pane. - GhosttyRuntime reads unfocused-split-opacity and unfocused-split-fill via ghostty_config_get, clamping the overlay opacity to [0, 1] and returning nil (with a SupaLogger warning) when both the fill and background keys are missing so the UI can skip the overlay rather than silently paint it black. - WorktreeTerminalTabsView threads the overlay config down to LeafView and bumps a SwiftUI invalidation counter on .ghosttyRuntimeConfigDidChange so live config reloads re-read the values. Split divider uses the system separator color. - SplitTreeTests locks in recordActiveSurface symmetry across the click and goto_split paths, dedup via emitFocusChangedIfNeeded, idempotence on the explicit path, and focus-loss as a no-op.
jzillmann
referenced
this pull request
in jzillmann/supacool
Apr 23, 2026
Surface which pane has focus by dimming inactive splits with Ghostty's own unfocused-split overlay semantics. - WorktreeTerminalState exposes activeSurfaceID(for:) backed by the single focusedSurfaceIdByTab source of truth. Click-path and explicit focus paths (goto_split, split zoom, palette) both funnel through the new recordActiveSurface choke point so two panes can't both claim active and focus-loss can't wipe the remembered active pane. - GhosttyRuntime reads unfocused-split-opacity and unfocused-split-fill via ghostty_config_get, clamping the overlay opacity to [0, 1] and returning nil (with a SupaLogger warning) when both the fill and background keys are missing so the UI can skip the overlay rather than silently paint it black. - WorktreeTerminalTabsView threads the overlay config down to LeafView and bumps a SwiftUI invalidation counter on .ghosttyRuntimeConfigDidChange so live config reloads re-read the values. Split divider uses the system separator color. - SplitTreeTests locks in recordActiveSurface symmetry across the click and goto_split paths, dedup via emitFocusChangedIfNeeded, idempotence on the explicit path, and focus-loss as a no-op.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unfocused-split-opacityandunfocused-split-fillconfig values — Supacode bypasses Ghostty'sSurfaceWrapper, so the overlay is applied here using the same semantics as upstream.focusedSurfaceIdByTab) with one choke point for mutation (recordActiveSurface), so mouse clicks,goto_split, split zoom, and palette actions can't drift apart.Closes #250
Closes #243
Test plan
goto_splitvia keybinding → active pane flips and the overlay follows.unfocused-split-opacity = 0.5in~/.config/ghostty/config, reload → overlay darkens to match.unfocused-split-opacity = 1→ overlay disappears entirely.unfocused-split-fill = #ff0000→ overlay tints red on the inactive pane.SplitTreeTests.recordActiveSurfaceSymmetryAcrossClickAndGotoSplitPaths(once theDependenciesTestSupporttest-target issue is fixed separately).