Skip to content

Preserve process title updates after detaching a panel - #9603

Closed
austinywang wants to merge 2 commits into
mainfrom
issue-4946-detached-workspace-pins-process-title-an
Closed

austinywang wants to merge 2 commits into
mainfrom
issue-4946-detached-workspace-pins-process-title-an

Conversation

@austinywang

@austinywang austinywang commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep process-derived titles in the automatic title path when a panel moves into a new workspace
  • pass a destination title into workspace customization only when the caller supplied an explicit title
  • cover a second OSC title update after the detach, including the destination workspace and moved panel titles

Previously, the process-derived destination title was passed through workspace creation as though it were a custom title. That pinned the new workspace and prevented later OSC title changes from becoming visible. The detached surface still seeds the automatic title, while explicit caller titles retain their existing behavior.

Fixes #4946

Testing

  • Red regression commit d8fb72a44b: the focused remote cmux-unit run failed with exit 65 before the fix:
    TEST_RUNNER_CMUX_TEST_PROCESS=1 xcodebuild -project cmux.xcodeproj -scheme cmux-unit -configuration Debug -destination 'platform=macOS' -derivedDataPath <isolated> -clonedSourcePackagesDirPath <isolated>/.ci-source-packages -resultBundlePath <isolated>/focused.xcresult CMUX_SKIP_ZIG_BUILD=1 SWIFT_SUPPRESS_WARNINGS=YES GCC_WARN_INHIBIT_ALL_WARNINGS=YES -only-testing:cmuxTests/AppDelegateMoveTabToNewWorkspaceTests test
  • Green fix commit 2c4e482811: the same focused remote command exited 0; the result bundle reported 7 passed, 0 failed.
  • ./scripts/reload-cloud.sh --tag sym4946 succeeded through the cloud path on blacksmith-6vcpu-macos-26 (run 30960418147).
  • Tagged socket dogfood on /tmp/cmux-debug-sym4946.sock: created a second panel, emitted Initial detached OSC title, ran break-pane, and observed the destination workspace with custom_title: null. A subsequent OSC update changed both workspace and moved-surface titles to Updated detached OSC title; scripted assertions passed. The tagged app was then quit with pkill -f "DerivedData/cmux-sym4946" and its stale tag socket was removed.
  • Localization audit: no user-facing strings changed.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Preserves process-driven titles after detaching a panel so the new workspace keeps following OSC/process title updates instead of pinning a custom title. Fixes #4946.

  • Bug Fixes
    • Pass nil for the destination workspace title unless the caller provided one; keep titleSource as .auto.
    • Apply subsequent OSC title updates to both the destination workspace and the moved panel.
    • Rename and extend test to cover post-detach title updates and scheduler behavior.

Written for commit 2c4e482. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Moved tabs now derive their destination workspace title from the active process title when no custom title is provided.
    • Destination workspace and panel titles continue updating when the moved process changes its title.
  • Tests

    • Expanded coverage for title updates after moving a tab to a new workspace.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 138a6160-d2ef-4a98-ba67-a1d5c776cec1

📥 Commits

Reviewing files that changed from the base of the PR and between 4cf7cc3 and 2c4e482.

📒 Files selected for processing (2)
  • Sources/AppDelegate+MoveTabToNewWorkspace.swift
  • cmuxTests/AppDelegateMoveTabToNewWorkspaceTests.swift

📝 Walkthrough

Walkthrough

Detached workspace creation now passes nil for automatic titles and preserves explicit titles. Tests verify that process-title updates continue after detachment and update the workspace and panel titles.

Changes

Detached workspace title handling

Layer / File(s) Summary
Preserve automatic titles after detachment
Sources/AppDelegate+MoveTabToNewWorkspace.swift, cmuxTests/AppDelegateMoveTabToNewWorkspaceTests.swift
Workspace creation passes nil when no explicit title exists. The test verifies initial process-derived naming and subsequent coalesced updates to the process, workspace, and panel titles.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: lawrencecchen

🚥 Pre-merge checks | ✅ 5 | ❌ 20

❌ Failed checks (20 inconclusive)

Check name Status Explanation Resolution
Cmux Swift Actor Isolation ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Blocking Runtime ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Browser Automation Off-Main ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Expensive Synchronous Load ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Cache Substitution Correctness ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Hacky Sleeps ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Algorithmic Complexity ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Concurrency ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift @Concurrent ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Package Boundaries ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swiftpm Lockfiles ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Logging ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux User-Facing Error Privacy ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Full Internationalization ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swiftui State Layout ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Architecture Rethink ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Auxiliary Window Close Shortcuts ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Source Artifacts ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Test Or Debug Seam In Production Source ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Ambient Global State ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: preserving process title updates after a panel detaches.
Description check ✅ Passed The description explains the cause, fix, testing, regression coverage, and linked issue; only optional checklist and video details are absent.
Linked Issues check ✅ Passed The change satisfies issue #4946 by preventing process-derived titles from setting customTitle and preserving later OSC title updates.
Out of Scope Changes check ✅ Passed All code and test changes directly support detached workspace title handling and regression coverage for issue #4946.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-4946-detached-workspace-pins-process-title-an

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot mentioned this pull request Aug 7, 2026
5 of 6 tasks
@lawrencecchen lawrencecchen added the stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening. label Sep 23, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in cmux backlog Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale-revisit Closed after 30+ days without activity; preserved for possible revisit or reopening.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detached workspace pins process title and blocks Claude OSC updates

3 participants