Skip to content

cmux import: write through the shared Ghostty config writers - #15055

Merged
teamleaderleo merged 1 commit into
mainfrom
import-use-shared-config-writers
Sep 27, 2026
Merged

teamleaderleo merged 1 commit into
mainfrom
import-use-shared-config-writers

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

cmux import (#15004) wrote font-family as a single line, replacing every earlier assignment. With the Settings font row from #15005, cmux's config can hold a font-family = "" reset followed by the chosen family; the import's one-line rewrite would drop that reset, so the imported font became a fallback after the user's other fonts instead of replacing them.

Now the import writes through the same shared writers as Settings and cmux themes:

  • Config keys go through CmuxGhosttyConfigSettingEditor.updatedContents(_:setting:values:) (via writeSetting(key:values:)). font-family is written as "" then the family, the same shape the Settings font row writes, so the imported font replaces the list.
  • The theme is selected through CmuxManagedThemeConfigFile, and the "old theme" shown in the diff is read from its managed block.
  • GhosttyConfigPatcher is now GhosttyConfigDiffer: it only builds the before/after listing the CLI prints (CRLF files still read without a stray \r). Keys already set to the imported values are skipped. New keys are appended by the shared writer, without the old # Imported from ... comment.
  • --json changes[].new is now a list of values, since font-family writes two lines.

Verification

  • swiftc -typecheck of the CmuxTerminalImport package sources: clean.
  • The package tests (differ tests rewritten for the reset-plus-family case, the CRLF case and the unchanged case; mapper test updated) and the CLI target were not compiled or run locally. CI runs both.

Changelog

Fixed: an imported font now replaces your font list instead of becoming a fallback

🤖 Generated with Claude Code


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

Makes cmux import write through the same shared config writers as Settings and cmux themes, so an imported font replaces your font list instead of becoming a fallback.

Previously the import rewrote font-family as a single line, dropping the font-family = "" reset that now precedes the chosen family. Now:

  • Config keys go through CmuxGhosttyConfigSettingEditor's writeSetting(key:values:); font-family is written as "" then the family.
  • The theme is selected through CmuxManagedThemeConfigFile.
  • GhosttyConfigPatcher becomes GhosttyConfigDiffer, which only builds the before/after listing the CLI prints; CRLF files are still read without a stray \r.
  • --json changes[].new is now a list of values, since font-family writes two lines.

Written for commit d57eaeb. Summary will update on new commits.

Review in cubic

An imported font now replaces the user's font list: font-family is written
as a reset ("") followed by the family through
CmuxGhosttyConfigSettingEditor.updatedContents(_:setting:values:), the same
multi-value writer the Settings font row uses. The previous one-line-per-key
rewrite would have dropped that reset and left the imported font as a
fallback after the user's fonts.

GhosttyConfigPatcher becomes GhosttyConfigDiffer, which only builds the
before/after listing (still CRLF-safe); every config write goes through the
shared editor, and the theme is selected through CmuxManagedThemeConfigFile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 32 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 0f9531c8-7145-45fe-8843-38f608eb4996

📥 Commits

Reviewing files that changed from the base of the PR and between ac51546 and d57eaeb.

📒 Files selected for processing (10)
  • CLI/CMUXCLI+Import.swift
  • Packages/macOS/CmuxTerminalImport/README.md
  • Packages/macOS/CmuxTerminalImport/Sources/CmuxTerminalImport/Mapping/GhosttyConfigDiff.swift
  • Packages/macOS/CmuxTerminalImport/Sources/CmuxTerminalImport/Mapping/GhosttyConfigDiffer.swift
  • Packages/macOS/CmuxTerminalImport/Sources/CmuxTerminalImport/Mapping/GhosttyConfigPatcher.swift
  • Packages/macOS/CmuxTerminalImport/Sources/CmuxTerminalImport/Mapping/GhosttyConfigSetting.swift
  • Packages/macOS/CmuxTerminalImport/Sources/CmuxTerminalImport/Mapping/GhosttyImportMapper.swift
  • Packages/macOS/CmuxTerminalImport/Tests/CmuxTerminalImportTests/GhosttyConfigDifferTests.swift
  • Packages/macOS/CmuxTerminalImport/Tests/CmuxTerminalImportTests/GhosttyConfigPatcherTests.swift
  • Packages/macOS/CmuxTerminalImport/Tests/CmuxTerminalImportTests/GhosttyImportMapperTests.swift

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.

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@teamleaderleo
teamleaderleo merged commit cc4e8cf into main Sep 27, 2026
70 checks passed
@teamleaderleo
teamleaderleo deleted the import-use-shared-config-writers branch September 27, 2026 19:24
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for d57eaeb1b3: every check was green at merge (21 verified; 17 skipped by policy). Full suite runs on main after merge.

rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 27, 2026
2fbaf0a ci: keep one root per multi-root mini at main; park pull request builds there (manaflow-ai#15056)
35b642c Add Don't ask again to close confirmation dialogs (manaflow-ai#15052)
cc4e8cf cmux import: write through the shared Ghostty config writers (manaflow-ai#15055)
a8ee58c Add base keymap presets for keyboard shortcuts (manaflow-ai#15003)
fc39e4c Embed cmux.json schema as a raw string so schema PRs merge (manaflow-ai#15048)
32d9435 Drive the cmux sidebar from Claude Code on SSH relay hosts (manaflow-ai#14974)

# Conflicts:
#	.github/workflows/ci-guards.yml
#	.github/workflows/ci-macos.yml
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