Skip to content

Fix cmux themes ctrl navigation#4366

Closed
lawrencecchen wants to merge 2 commits into
mainfrom
issue-themes-broken-ctrl-np
Closed

Fix cmux themes ctrl navigation#4366
lawrencecchen wants to merge 2 commits into
mainfrom
issue-themes-broken-ctrl-np

Conversation

@lawrencecchen
Copy link
Copy Markdown
Contributor

@lawrencecchen lawrencecchen commented May 19, 2026

Summary

What changed:

  • Added PTY regression coverage for cmux themes Ctrl-N and Ctrl-P navigation.
  • Updated the Ghostty submodule to Add ctrl navigation to cmux theme picker ghostty#60.
  • Pinned and published the matching GhosttyKit asset for 176bd550f6fedd29e85cd92470e5dfadf295ebf7.
  • Documented the new Ghostty fork patch in docs/ghostty-fork.md.

Why:

  • cmux themes accepted j and k, but Ctrl-N and Ctrl-P did not move selection, so Enter could apply the wrong highlighted theme.
  • The regression test verifies the written theme = light:X,dark:X line so this cannot silently pass by only checking that a config file exists.

Testing

  • Red: tests/test_bundled_ghostty_theme_picker_helper.sh failed before the fix with Ctrl-N still applying the first bundled theme, expected 12-bit Rainbow, got 0x96f.
  • Green: tests/test_bundled_ghostty_theme_picker_helper.sh passed after the fix against the rebuilt tagged app.
  • Local tagged app test: CMUX_APP_PATH="$HOME/Library/Developer/Xcode/DerivedData/cmux-themesfix/Build/Products/Debug/cmux DEV themesfix.app" tests/test_bundled_ghostty_theme_picker_helper.sh.
  • GhosttyKit checksum present: ./tests/test_ci_ghosttykit_checksum_present.sh.
  • GhosttyKit download and checksum verification: GHOSTTY_SHA=176bd550f6fedd29e85cd92470e5dfadf295ebf7 GHOSTTYKIT_OUTPUT_DIR=/tmp/cmux-ghosttykit-download-check ./scripts/download-prebuilt-ghosttykit.sh.
  • GhosttyKit checksum verification helper: ./tests/test_ci_ghosttykit_checksum_verification.sh.
  • Tagged reload: ./scripts/reload.sh --tag themesfix.
  • Red test commit: 96e89a8d5 test: cover cmux theme picker ctrl navigation.
  • Fix commit: 7b0d5675c fix: support ctrl navigation in cmux themes.

Proof

  • Cloud run: https://github.com/manaflow-ai/cmux-loader/actions/runs/26090121825.
  • Before video: /Users/lawrence/fun/cmuxterm-hq/cmux-assets/issue-themes-broken-ctrl-np/auto-issue/20260519-030016/before/recording.mov.
  • Before TLDR: TextEdit shows the cloud-run PTY regression report where Ctrl-N still writes theme = light:0x96f,dark:0x96f and exits 1.
  • Before checked frames: /Users/lawrence/fun/cmuxterm-hq/cmux-assets/issue-themes-broken-ctrl-np/auto-issue/20260519-030016/before/frames/02.png and /Users/lawrence/fun/cmuxterm-hq/cmux-assets/issue-themes-broken-ctrl-np/auto-issue/20260519-030016/before/frames/tail.png.
  • Before metadata: 742x508, 14.196667s, 664341 bytes.
  • After video: /Users/lawrence/fun/cmuxterm-hq/cmux-assets/issue-themes-broken-ctrl-np/auto-issue/20260519-030016/after/recording.mov.
  • After TLDR: TextEdit shows the cloud-run PTY regression report passing for Ctrl-N and Ctrl-P with exit 0.
  • After checked frames: /Users/lawrence/fun/cmuxterm-hq/cmux-assets/issue-themes-broken-ctrl-np/auto-issue/20260519-030016/after/frames/02.png and /Users/lawrence/fun/cmuxterm-hq/cmux-assets/issue-themes-broken-ctrl-np/auto-issue/20260519-030016/after/frames/tail.png.
  • After metadata: 742x508, 13.203333s, 500476 bytes.

Artifacts

Notes

  • The first commit is test-only. The second commit updates the Ghostty submodule pointer, GhosttyKit checksum, and docs.
  • Direct Terminal automation on the cloud Mac was blocked by the Computer Use safety policy, so the videos capture the generated PTY proof reports in a macOS window.

Checklist

  • Regression test added before the fix.
  • Fix implemented in Ghostty and consumed by cmux through the submodule pointer.
  • GhosttyKit asset published and checksum pinned.
  • Local green test run against the tagged app.
  • Cloud before and after proof recorded.
  • Tagged dogfood build reloaded.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment May 19, 2026 11:35am
cmux-staging Building Building Preview, Comment May 19, 2026 11:35am

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

📝 Walkthrough

Walkthrough

The ghostty submodule is bumped to a commit that adds Ctrl-N/Ctrl-P navigation to the cmux theme picker; docs and the pinned xcframework reference are updated, a checksum entry is added, and tests are extended to validate Ctrl-N and Ctrl-P picker scenarios.

Changes

Ctrl Navigation Support in Theme Picker

Layer / File(s) Summary
Documentation of ctrl navigation feature
docs/ghostty-fork.md
Fork documentation updated to the new 176bd550f SHA, adds the commit to the theme picker helper hooks, documents that cmux-managed picker sessions support Ctrl-N / Ctrl-P for one-row down/up navigation, and updates the pinned xcframework artifact reference.
Submodule update and checksum pinning
ghostty, scripts/ghosttykit-checksums.txt
ghostty submodule pointer advanced to 176bd550f6fedd29e85cd92470e5dfadf295ebf7 and scripts/ghosttykit-checksums.txt gains the matching sha256 checksum entry.
Test expansion for ctrl navigation scenarios
tests/test_bundled_ghostty_theme_picker_helper.sh
Test script adds temporary config paths for Ctrl-N/Ctrl-P, updates the embedded Python harness with assert_theme_written and expected_theme handling, runs four scenarios (normal, search, Ctrl-N, Ctrl-P), and records all config paths for validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit hops through modes with glee,
Ctrl-N and Ctrl-P now dance with ease,
Docs point the fork, checksums locked tight,
Tests run four ways beneath the moonlight,
Themes settle in — a soft, tidy night.

🚥 Pre-merge checks | ✅ 17
✅ Passed checks (17 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix cmux themes ctrl navigation' directly and concisely summarizes the primary change—fixing control key navigation in the cmux theme picker.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PR contains no production Swift code changes—only documentation, submodule updates, checksums, and test shell scripts. Actor isolation check not applicable.
Cmux Swift Blocking Runtime ✅ Passed No production Swift modifications. Only changes: documentation file, submodule pointer, checksums, and test script with deterministic Python test scaffolding (time.sleep for process cleanup).
Cmux No Hacky Sleeps ✅ Passed Test-only PR with time.sleep(0.05) in deterministic test scaffolding for process cleanup with bounded deadline. Complies with allowed test-only sleeps per rule.
Cmux Swift Concurrency ✅ Passed No Swift code changes in cmux. Modified files are documentation, config, and test scripts only. Check applies to cmux-owned Swift code, so inapplicable.
Cmux Swift @Concurrent ✅ Passed PR contains no Swift code changes. All modifications are documentation, checksums, and shell scripts. The @concurrent annotation check does not apply.
Cmux Swift File And Package Boundaries ✅ Passed PR contains no Swift file changes. Modifications are to documentation, submodule refs, checksums, and test scripts. The check does not apply.
Cmux Swift Logging ✅ Passed No Swift production code changes in this PR. All modifications are non-Swift: documentation, config, data, and test files. Check not applicable.
Cmux User-Facing Error Privacy ✅ Passed All changes are documentation, test code, or build metadata. No user-facing error messages, credentials, or sensitive information exposed. All categories are explicitly allowed under the rule.
Cmux Full Internationalization ✅ Passed PR contains only test files, operational documentation, and literal config tokens—all exempt from internationalization requirements per full-internationalization.md rules.
Cmux Swiftui State Layout ✅ Passed PR contains no SwiftUI code changes. Changes are documentation, submodule reference, checksums, and bash/python test script only. SwiftUI state layout rules do not apply.
Cmux Architecture Rethink ✅ Passed PR contains no Swift code changes; only docs, submodule pointer, checksums, and shell/Python test script. PTY test synchronization uses standard patterns (select, waitpid), not architectural patches.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed No Swift code changes in this PR. Only Markdown docs, configuration files, checksums, and shell scripts modified. Swift window checks do not apply.
Description check ✅ Passed PR description comprehensively covers all template sections with detailed changes, rationale, testing methodology, proof links, and checklist completion.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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-themes-broken-ctrl-np

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 and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR adds PTY regression coverage for Ctrl-N/Ctrl-P navigation in the bundled Ghostty theme picker and advances the Ghostty submodule to the commit that implements the fix. All related documentation, checksums, and submodule references are kept in sync.

  • Test: Two new run_picker scenarios exercise Ctrl-N (move to second theme) and Ctrl-P (return to first theme), backed by a new assert_theme_written helper that verifies the correct theme = light:X,dark:X line was written to the config file.
  • Submodule + checksums: ghostty submodule advanced to 176bd550f; a matching SHA256 entry appended to scripts/ghosttykit-checksums.txt.
  • Docs: docs/ghostty-fork.md preamble, section-4 commit list, section-4 summary, and footer all updated to the new SHA and release tag; the previously stale ff6e1260d references are fully resolved.

Confidence Score: 5/5

Safe to merge — changes are test additions, a submodule pointer bump, a checksum append, and documentation updates with no production Swift or runtime code touched.

All four changed files are either test scaffolding, a submodule reference, a checksums registry, or documentation. The test logic correctly models the picker's alphabetical sort order, the Ctrl-N/Ctrl-P byte sequences are the standard ASCII control codes, and all previously stale SHA references in the docs have been updated to the new submodule head.

No files require special attention.

Important Files Changed

Filename Overview
tests/test_bundled_ghostty_theme_picker_helper.sh Adds Ctrl-N and Ctrl-P PTY regression scenarios with theme-content validation; logic is correct and consistent with the picker's alphabetical sort order.
docs/ghostty-fork.md Preamble, commit list, section 4 summary, and footer all updated to the new submodule SHA 176bd550f and new release tag/branch; all previously stale references resolved.
scripts/ghosttykit-checksums.txt New SHA256 entry appended for 176bd550f; format matches every existing entry.
ghostty Submodule pointer advanced from ff6e1260d to 176bd550f; consistent with the checksum file and documentation updates.

Sequence Diagram

sequenceDiagram
    participant Test as test_bundled_ghostty_theme_picker_helper.sh
    participant PTY as PTY (pty.fork)
    participant Helper as ghostty +list-themes
    participant Config as scenario_config.ghostty

    Test->>PTY: "fork child with CMUX_THEME_PICKER_* env vars"
    PTY->>Helper: execve ghostty +list-themes
    Helper-->>PTY: renders picker UI (stdout)
    PTY-->>Test: output includes "Enter apply"
    Test->>PTY: "write scripted_input (\x0e=Ctrl-N, \x10=Ctrl-P, \r=Enter)"
    Helper->>Config: "writes theme = light:X,dark:X"
    Helper-->>PTY: exits 0
    PTY-->>Test: child exits
    Test->>Config: assert_theme_written(expected_theme)
    Test->>Test: bash loop validates start/end markers + theme line
Loading

Reviews (4): Last reviewed commit: "fix: support ctrl navigation in cmux the..." | Re-trigger Greptile

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/ghostty-fork.md (1)

80-91: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the “current pinned head/release tag” sections to match 176bd550f.

After adding 176bd550f here, the document still says the current pin is ff6e1260d (Line 16) and still references xcframework-ff6e1260d... as the current published/pinned archive (Line 24, Lines 216-219). Please update those sections so this doc has a single authoritative current head.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/ghostty-fork.md` around lines 80 - 91, Update the document's "current
pinned head/release tag" references from ff6e1260d to 176bd550f: find every
occurrence of the old tag (e.g., the header that states the current pinned head,
any mentions like "xcframework-ff6e1260d..." and the published/pinned archive
references) and replace them with 176bd550f so the document consistently shows
the new pinned head; verify the commit id is updated in the summary and any
archive filenames or release-tag strings throughout the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/ghostty-fork.md`:
- Around line 80-91: Update the document's "current pinned head/release tag"
references from ff6e1260d to 176bd550f: find every occurrence of the old tag
(e.g., the header that states the current pinned head, any mentions like
"xcframework-ff6e1260d..." and the published/pinned archive references) and
replace them with 176bd550f so the document consistently shows the new pinned
head; verify the commit id is updated in the summary and any archive filenames
or release-tag strings throughout the file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a9d60877-19b1-402e-bf0f-8ca676468830

📥 Commits

Reviewing files that changed from the base of the PR and between 1a011d9 and 6e0f22c.

📒 Files selected for processing (4)
  • docs/ghostty-fork.md
  • ghostty
  • scripts/ghosttykit-checksums.txt
  • tests/test_bundled_ghostty_theme_picker_helper.sh

@lawrencecchen
Copy link
Copy Markdown
Contributor Author

Superseded by the targeted stacked follow-up PR: #4404.

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