Repository navigation
Add cmux import for settings from other terminals - #15004
Conversation
`cmux import` lists iTerm2, Terminal, Alacritty, Kitty, WezTerm and Warp settings found on this Mac; `cmux import <terminal> [--dry-run]` maps the font, 16 ANSI plus special colors, cursor style and blink, Option-as-Alt, padding, opacity/blur and scrollback into a generated Ghostty theme and cmux's own Ghostty config, printing each line with its previous value and listing what was not imported. Ghostty users get a notice, since cmux already loads their config. Parsing and mapping live in the new pure CmuxTerminalImport package with fixture tests per source. Settings > Terminal gains an "Import from Another Terminal" row that opens a terminal tab running `cmux import`, sharing the theme picker's launch path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 1 minute. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (68)
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 |
|
All contributors have signed the CLA ✍️ ✅ |
- Reject NaN, infinity and overflowing numbers from every source and clamp huge ones before converting to Int, so values like `1e999` can no longer trap. The mapper caps padding and blur and computes scrollback bytes with overflow checking. Adds malformed-number fixture tests. - Decode Terminal's NSColor/NSFont archives with secure coding on; the stand-in classes adopt NSSecureCoding and are the only allowed classes. - Writing from a script, pipe or with --json now requires --yes. - The config patcher keeps CRLF files CRLF and drops the stray `\r` from values; CRLF test added. - Help usage lists --yes, --path and --json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI failure attributionCI passes on Written by |
|
Toolbox g1 🔔 reviewed the importer’s parser/mapper fixtures, hostile-number and secure-archive hardening, CLI confirmation gate, and settings entrypoint. Required checks are green and the branch is clean against main; landing this self-contained feature before the currently-running CI repair PRs. |
|
Merge receipt for |
8efe28d Add terminal.confirmUnsafePaste to confirm unsafe pastes in a window sheet (manaflow-ai#14951) 368ec9f fix(ci): restore app-host artifact rerun setup (manaflow-ai#15029) e67ea0f perf: stop launching the cmux CLI for every queued Claude hook (manaflow-ai#14931) badf9f6 test: give the tmux split mapping test its own portal authority (manaflow-ai#15028) 41a0c37 current-work: preserve remote machine kinds (manaflow-ai#14914) c842f7d test(hermes): wait for the hook installer instead of racing a 1 s deadline (manaflow-ai#15027) 810ffba fix(ci): resolve binary modules in detached test reruns (manaflow-ai#15026) d363290 test: await fork probe fixture start signals (manaflow-ai#15025) 8c98e64 Add cmux import for settings from other terminals (manaflow-ai#15004) 30aa6c1 Keep SSH workspace titles when cmux-tui creates the remote workspace (manaflow-ai#14976) b33c467 Restore workspace group color and icon key handling from manaflow-ai#13877 (manaflow-ai#15000) # Conflicts: # .github/workflows/app-host-test-rerun.yml # .github/workflows/ci-macos.yml
People switching to cmux from another terminal had to rebuild their font, colors and cursor by hand in Ghostty syntax.
cmux importnow does it:cmux importlists the terminals with settings on this Mac (iTerm2, Terminal, Alacritty, Kitty, WezTerm, Warp) and, in a TTY, asks which to import. Ghostty is listed as already loaded: cmux reads~/.config/ghostty/config, so there is nothing to do.cmux import <terminal> [--dry-run] [--yes] [--path <file>] [--json]prints every line it will write with the previous value (-/+), then asks before writing. Without a terminal to ask in (scripts, pipes) or with--json, it writes only with--yes.--dry-runwrites nothing.cmux import, through the same helper the Theme "Choose…" button now uses.What gets mapped:
cmux-import-<terminal>in cmux's themes folder, selected by absolute path through the existing# cmux themesblock (iTerm2 profiles with separate light/dark colors get alight:...,dark:...pair)font-family,font-size(iTerm2/Terminal PostScript names resolved to families via CoreText; a font that isn't installed system-wide, like Terminal's bundled SF Mono Terminal, is skipped and reported)cursor-style,cursor-style-blinkuseOptionAsMetaKey, Kitty/Alacritty/WezTerm equivalentsmacos-option-as-altwindow-padding-x,window-padding-ybackground-opacity,background-blurscrollback-limitonly when the line count needs more than Ghostty's 50 MB default (estimated at 2 KB a line); otherwise the report says the default already covers itWrites go only to cmux's own
config.ghosttyand its themes folder. The user's~/.config/ghostty/configand the other terminal's files and preferences are only read. Each written key ends up assigned once (repeatable keys likefont-familywould otherwise stack), existing keys are replaced in place, and new ones are appended under a# Imported from <terminal> by cmux importcomment.Honest limits, each printed under "Not imported or approximated": WezTerm is read without running Lua, so only literal top-level
config.x = ...andreturn { ... }values are imported and anything computed or insideif/functions is named as skipped; a WezTermcolor_schemename is reported with acmux themes sethint. Warp imports theme colors only (it keeps fonts in app state). Kittyglobinclude/envinclude, bold/italic font overrides, line spacing, background images and dim colors are reported, not mapped.Parsing and mapping live in a new pure package,
Packages/macOS/CmuxTerminalImport(no AppKit: Terminal'sNSColor/NSFontarchives are decoded with secure coding on, through stand-inNSSecureCodingclasses that are the only allowed classes), with fixture-based tests for every source plus the mapper and config patcher. NaN, infinity and overflowing numbers (1e999) are rejected and huge values clamped, so a malformed config can't trap; a malformed-numbers fixture covers it. CRLF configs stay CRLF. It is linked intocmux-clionly and added to the swift-package-tests list.Verification
swift test --package-path Packages/macOS/CmuxTerminalImport: 25 tests in 6 suites passed locally on the first commit. The follow-up hardening commit (number guards, secure-coding decode, CRLF,--yesgating, new tests) was not compiled or run locally; CI is the first check of it.CMUXCLI+Import.swifttypechecked locally against the built package with stubbed CLI helpers, and a throwaway runner exercised list,--dry-runand a real write against a temp home using the Kitty fixtures.python3 scripts/verify-local.py: 13/13 static checks passed. The app and CLI targets were not built locally; CI compiles them.Not included: the Settings search index entry (the neighboring Theme row isn't indexed either) and web docs (the command is documented where
cmux themesis: CLI help,docs/cli-contract.mdand the customization skill).Changelog
Added:
cmux importand a Settings > Terminal "Import from Another Terminal" button bring font, colors, cursor, Option-as-Alt, padding, opacity and scrollback over from iTerm2, Terminal, Alacritty, Kitty, WezTerm or Warp.🤖 Generated with Claude Code