Repository navigation
Fix #5917: restore OSC 11 pane-local backgrounds - #5997
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughRefactored backdrop resolution to prevent OSC 11 pane-local surface colors from replacing the shared window backdrop. Introduced ChangesPane-Local OSC 11 Backdrop Handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (19 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes issue #5917 by ensuring that OSC 11 pane-local background overrides are applied only to the surface fill layer, not to the shared window root backdrop. The root snapshot loaded from UserDefaults is now always preserved as the workspace/default background.
Confidence Score: 5/5Safe to merge — the change is tightly scoped to the backdrop resolution path, the invariant is enforced structurally, and the deleted helper has no remaining callers. The fix correctly isolates OSC 11 to the pane surface fill layer by making windowRootBackdropResolution always return the unmodified workspace snapshot. The removed effectiveBackgroundColor helper had no other callers. The new regression test exercises the exact bug scenario end-to-end. No production logic is left in a fragile or ambiguous state. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[applyWindowBackgroundIfActive] --> B[applySurfaceBackground]
B --> C{Has OSC 11 override?}
C -- yes --> D[TerminalSurfaceBackgroundFillPlan\nowner: surfaceHostLayer\ncolor: OSC 11 color]
C -- no --> E[TerminalSurfaceBackgroundFillPlan\nowner: default\ncolor: workspace default]
A --> F[windowRootBackdropResolution\nsurfaceBackgroundColor: backgroundColor]
F --> G[Always returns self\nunchanged workspace snapshot]
G --> H[windowRoot.snapshot.backdropPlan]
H --> I[WindowBackdropController.apply\nShared window root = workspace default]
D -.-> J[Pane surface layer only]
I --> K[Window backdrop layer\nalways workspace/default color]
Reviews (3): Last reviewed commit: "fix: remove stale background color helpe..." | Re-trigger Greptile |
| func windowRootBackdropSnapshot(surfaceBackgroundColor _: NSColor?) -> Self { | ||
| // OSC 11 is pane-local state; the shared root remains the workspace backdrop. | ||
| self | ||
| } |
There was a problem hiding this comment.
Parameter accepted but permanently ignored
surfaceBackgroundColor is labelled _: because the implementation unconditionally returns self. While the comment explains the invariant, calling code still constructs the optional NSColor and passes it, and any future reader must understand why a parameter exists solely to be discarded. If the method will never use the surface color, consider removing the parameter entirely and updating the call site to snapshot (no method call needed) — that would make the invariant "OSC 11 never touches the shared root" impossible to violate by passing a different value.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Addressed by replacing the ignored-parameter helper with windowRootBackdropResolution(...), which preserves the shared root snapshot while deriving source/override log metadata from the pane color.
— Claude Code
PRs included: - AppDelegate decomposition: CmuxSession session-snapshot repository (manaflow-ai#6030) - Fix Cmd+T cwd after session restore (manaflow-ai#6055) - Speed up iOS terminal scroll rendering (manaflow-ai#6035) - Preserve Pi sessions across workspace restore (manaflow-ai#5607) - Scope Biome checks to maintained JS sources (manaflow-ai#6008) - Fix manaflow-ai#5917: restore OSC 11 pane-local backgrounds (manaflow-ai#5997) - Expose stable window title templates (manaflow-ai#6059) - Honor macos-option-as-alt left/right - Fix macOS 27 SF Symbol rasterization crash (manaflow-ai#5999) - CmuxRemote* family: extract Workspace remote/cloud-VM connectivity - Fix iOS workspace swipe-delete confirmation crash (manaflow-ai#6051) - TabManager decomposition Wave 3+4 sub-models - Sidebar row cleanups: branchless frame anchor - CmuxIPCService: extract AppDelegate multi-window CLI routing - CmuxSidebarGit: extract TabManager git-metadata + PR-polling subsystem - CmuxTerminalCore: extract terminal core leaf Fork-side adjustments: - ghostty submodule: cherry-pick mouse-modifier-state fix onto our renderer-realized branch - Workspace.swift: take theirs (upstream extracted ~7700 lines into CmuxCore.Remote/CmuxRemoteSession packages); restore fork's renameTopLevelLayoutTabContaining/closeTopLevelLayoutTabContaining + surfaceTmuxClientTTYNames + WorkspaceLayoutTab integration - TabManager.swift: take theirs; re-add static allocatePortOrdinal() - BrowserPanelView, RenderableSystemSymbol: keep fork's cmuxSymbolPixelSize extension on top of upstream's cmuxSymbolRasterSize - Add CmuxWorkspaces / CMUXSessionDaemon / CmuxCommandPalette imports to TerminalController, Workspace, SessionPersistence - Sources/Workspace+P43Stubs.swift: thin shims for SplitEqualizer, WorkspaceRemoteSessionController.PortScanKickReason, WorkspaceGroupNewWorkspacePlacementSettings (legacy types fork TC still calls; replace with package APIs in P44+) - Sources/GhosttySurfaceSizeDeferralReason.swift: restore fork-only enum (deleted by upstream) - Sources/StableLayout/SessionBlueprintExportAction.swift: parked debug action (depends on legacy SessionPersistenceStore, gone) - Sources/GhosttyTerminalView.swift: stub ghostty_surface_select_cursor_line_compat (needs zig 0.15.2 xcframework rebuild) - pbxproj: keep-both, drop stale ProcessPipeReader/SplitEqualizer/Panels/BrowserProxyEndpoint refs, fix SurfaceHibernationPolicy UUID collision - Drop fork's WorkspaceRemoteConfiguration.swift + WorkspaceRemoteSSHBatchCommandBuilder.swift (extracted to CmuxCore package)
Closes #5917
Summary
Regression provenance
replacingTerminalBackgroundColor). This PR keeps the simplified shared root behavior while restoring pane-local OSC 11 isolation.Testing
git diff --checkManual dogfood after CI green
Run only after explicit launch approval:
CMUX_SKIP_ZIG_BUILD=1 ./scripts/reload.sh --tag issue-5917-osc11-per-pane-background --launchThen in a plain shell pane run
printf '\e]11;#E6BE78\a'; the receiving pane should turn#E6BE78while neighboring panes keep the shared/default backdrop.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Restores per-pane OSC 11 backgrounds without tinting the shared window root. The workspace/default background stays on the root; OSC 11 colors only affect the target pane.
replacingTerminalBackgroundColor(...)withwindowRootBackdropResolution(surfaceBackgroundColor:)that preserves the root snapshot; usecompositedTerminalBackgroundColorwhen applying the plan.Written for commit a122f8b. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests