Skip to content

Support Ctrl-N/Ctrl-P in cmux themes on main#4474

Open
lawrencecchen wants to merge 3 commits into
mainfrom
followup-themes-main-full
Open

Support Ctrl-N/Ctrl-P in cmux themes on main#4474
lawrencecchen wants to merge 3 commits into
mainfrom
followup-themes-main-full

Conversation

@lawrencecchen
Copy link
Copy Markdown
Contributor

@lawrencecchen lawrencecchen commented May 21, 2026

Summary

  • Open a main-targeted follow-up for the remaining cmux themes picker breakage.
  • Main already contains Austin Wang's repeated theme reload fix from Fix repeated cmux themes set reloads #4359.
  • Add Ctrl-N and Ctrl-P one-row navigation support by advancing the Ghostty submodule to Add ctrl navigation to cmux theme picker ghostty#60.
  • Add behavior-level PTY regression coverage that proves Ctrl-N selects the next theme and Ctrl-N then Ctrl-P returns to the original theme before Enter applies it.
  • Pin the matching GhosttyKit artifact and update docs/ghostty-fork.md.

Testing

  • ./tests/test_ci_ghosttykit_checksum_present.sh
  • GHOSTTY_SHA=176bd550f6fedd29e85cd92470e5dfadf295ebf7 GHOSTTYKIT_OUTPUT_DIR=/tmp/cmux-ghosttykit-npmain-check ./scripts/download-prebuilt-ghosttykit.sh
  • ./tests/test_ci_ghosttykit_checksum_verification.sh
  • ./scripts/reload.sh --tag npmain
  • CMUX_APP_PATH="$HOME/Library/Developer/Xcode/DerivedData/cmux-npmain/Build/Products/Debug/cmux DEV npmain.app" tests/test_bundled_ghostty_theme_picker_helper.sh

Regression Structure

  • First commit is test-only and fails before the Ghostty fix.
  • Second commit updates the Ghostty submodule pointer, GhosttyKit checksum, and fork docs.

Related


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.


Note

Medium Risk
Moderate risk because it bumps the bundled GhosttyKit/ghostty pin that affects runtime theme-picker behavior and distribution artifacts, though changes are scoped and covered by new PTY tests.

Overview
Advances the pinned Ghostty fork/GhosttyKit release to a new head that adds Ctrl-N/Ctrl-P one-row navigation in cmux-managed theme picker sessions, and updates the fork documentation accordingly.

Extends test_bundled_ghostty_theme_picker_helper.sh to run the picker in a PTY with an isolated XDG_CONFIG_HOME, dynamically discover bundled themes, and assert that Ctrl-N selects the next theme and Ctrl-N then Ctrl-P returns to the original theme before Enter writes the expected override config.

Reviewed by Cursor Bugbot for commit 2665899. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Adds Ctrl‑N/Ctrl‑P one-line navigation to the cmux theme picker on main by updating the ghostty fork and pinning the matching GhosttyKit. Strengthens PTY tests with dynamic theme discovery, a timeout for theme listing, and isolated config to verify the correct theme is written.

  • New Features

    • Support Ctrl‑N (down) and Ctrl‑P (up) in the cmux theme picker.
    • Extend PTY tests with +list-themes --plain, a discovery timeout, XDG_CONFIG_HOME isolation, and asserts for normal, search, Ctrl‑N, and Ctrl‑P flows.
  • Dependencies

    • Update ghostty submodule to the fork head that includes Ctrl‑N/Ctrl‑P.
    • Pin matching GhosttyKit release and checksum; update docs/ghostty-fork.md with the new tag and branch.

Written for commit 2665899. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features

    • Added Ctrl‑N / Ctrl‑P keyboard navigation to the theme picker for one-row down/up movement.
  • Documentation

    • Refreshed Ghostty fork documentation and release references to match the updated build and included behavior.
  • Tests

    • Expanded theme picker tests to cover Ctrl‑N/Ctrl‑P navigation scenarios and verify selected theme output.
  • Chores

    • Updated bundled Ghostty reference and checksum for the refreshed xcframework build.

Review Change Stack

@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.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

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

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment May 21, 2026 1:48pm
cmux-staging Ready Ready Preview, Comment May 21, 2026 1:48pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

📝 Walkthrough

Walkthrough

Repoints Ghostty to a new pinned commit adding Ctrl-N/Ctrl-P navigation to the cmux theme picker, updates the xcframework checksum and fork documentation/changelog, and extends the bundled picker test to exercise and validate Ctrl-N/Ctrl-P scenarios.

Changes

Ghostty fork update with keyboard navigation support

Layer / File(s) Summary
Ghostty submodule and checksum baseline
ghostty, scripts/ghosttykit-checksums.txt
Ghostty submodule reference updated to the new commit SHA; GhosttyKit xcframework checksum for that build added.
Fork documentation and changelog
docs/ghostty-fork.md
Docs updated to the new pinned head, prebuilt xcframework tag/URL, and changelog entries describing Ctrl-N/Ctrl-P one-row down/up navigation in the cmux theme picker.
Ctrl-N/Ctrl-P navigation test coverage
tests/test_bundled_ghostty_theme_picker_helper.sh
Test adds isolated XDG_CONFIG_HOME and separate Ctrl-N/Ctrl-P config paths, discovers bundled themes via the helper, asserts theme file contents, runs picker scenarios with scripted Ctrl-N/Ctrl-P input, and records config paths.

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs:

  • manaflow-ai/cmux#4291: Also repoints the ghostty submodule and updates docs/ghostty-fork.md and scripts/ghosttykit-checksums.txt for a different Ghostty pin.

"A rabbit tapped the keyboard light,
Ctrl‑N, Ctrl‑P — hop left and right,
Docs and tests in tidy rows,
Ghostty's picker now surely knows,
Hoppity cheer for code that flows!"

🚥 Pre-merge checks | ✅ 17
✅ Passed checks (17 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Support Ctrl-N/Ctrl-P in cmux themes on main' directly and specifically describes the main change: adding keyboard navigation shortcuts to the 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 No Swift production code modified. Changes limited to: documentation, test scripts, checksums data, and git submodule pointer.
Cmux Swift Blocking Runtime ✅ Passed PR changes only modify non-Swift files (docs, checksums, test shell script) and update submodule references; no production Swift blocking patterns are introduced or expanded.
Cmux No Hacky Sleeps ✅ Passed PR only adds test-only code with deterministic timing. The time.sleep(0.05) is test scaffolding for PTY cleanup, allowed per rule.
Cmux Swift Concurrency ✅ Passed PR introduces no cmux-owned Swift code changes—only documentation, submodule pointer, checksums, and bash/Python test files. The concurrency check is not applicable.
Cmux Swift @Concurrent ✅ Passed PR contains no Swift code changes—only documentation, checksums, test scripts, and submodule reference updates. The @concurrent annotation rules are not applicable.
Cmux Swift File And Package Boundaries ✅ Passed PR contains no Swift production file changes; custom check applies only to Swift file/package boundaries and is not applicable here.
Cmux Swift Logging ✅ Passed PR only modifies documentation, checksums, test shell scripts, and submodule references—no production Swift code changes.
Cmux User-Facing Error Privacy ✅ Passed All changes are in test files and documentation, which are explicitly allowed. No production user-facing error messages expose sensitive information.
Cmux Full Internationalization ✅ Passed PR contains only documentation updates, submodule pointer changes, checksum entries, and test script additions—all exempt from localization requirements per the rule.
Cmux Swiftui State Layout ✅ Passed PR contains no SwiftUI code changes: only documentation, submodule reference, checksum, and test script updates. SwiftUI state layout check is not applicable.
Cmux Architecture Rethink ✅ Passed PR modifies only documentation, submodule reference, checksums, and test scripts—zero Swift source code changes. Test-only sleep in cleanup loop is permitted.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR contains no Swift code changes. Check applies only to Swift window code changes; PR modifies only docs, submodule, checksums, and bash test script.
Description check ✅ Passed The PR description includes all required template sections: Summary explains what changed and why, Testing documents verification steps, and Checklist items are addressed.

✏️ 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 followup-themes-main-full

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 21, 2026

Greptile Summary

This PR adds Ctrl-N (down) and Ctrl-P (up) one-row navigation to the cmux theme picker by advancing the pinned ghostty submodule to a fork head that includes the keyboard handler, updating the matching GhosttyKit checksum, and refreshing docs/ghostty-fork.md.

  • Ghostty submodule advanced from ff6e1260d to 176bd550f; scripts/ghosttykit-checksums.txt and release-tag references in the fork doc updated to match.
  • Test coverage expanded with two new PTY scenarios: Ctrl-N selects the second theme, and Ctrl-N then Ctrl-P returns to the first theme before Enter writes the config. XDG_CONFIG_HOME is now isolated per test run and themes are discovered dynamically via +list-themes --plain rather than being hardcoded.

Confidence Score: 5/5

Safe to merge — changes are confined to the submodule pointer, its pinned checksum, documentation, and test scaffolding with no production Swift or runtime code altered.

The diff touches only the Ghostty submodule pointer, the corresponding prebuilt checksum, documentation, and a test-only shell/Python script. No production Swift, no runtime logic, and no app behaviour is changed directly. The test additions are well-structured and the XDG isolation is a clear improvement over the previous approach.

No files require special attention beyond confirming the new GhosttyKit checksum matches the published artifact.

Important Files Changed

Filename Overview
tests/test_bundled_ghostty_theme_picker_helper.sh Adds Ctrl-N/Ctrl-P PTY test scenarios with XDG_CONFIG_HOME isolation and dynamic theme discovery. Minor: missing CalledProcessError handler on the +list-themes --plain subprocess call.
ghostty Submodule pointer advanced from ff6e1260d to 176bd550f to pick up Ctrl-N/Ctrl-P theme picker support.
scripts/ghosttykit-checksums.txt New SHA256 checksum row added for the 176bd550f GhosttyKit artifact; consistent with the submodule advance.
docs/ghostty-fork.md Documentation updated to reflect new fork head, release tag, branch name, and Ctrl-N/Ctrl-P feature entry.

Sequence Diagram

sequenceDiagram
    participant Test as test_bundled_ghostty_theme_picker_helper.sh
    participant PY as Python inline script
    participant Helper as ghostty helper (+list-themes)
    participant PTY as PTY subprocess

    Test->>PY: launch python3 heredoc
    PY->>Helper: +list-themes --plain (subprocess.run)
    Helper-->>PY: theme names list
    PY->>PY: parse first_theme, second_theme

    Note over PY,PTY: Ctrl-N navigation
    PY->>PTY: pty.fork → +list-themes
    PTY-->>PY: render (waits for Enter apply)
    PY->>PTY: send Ctrl-N + Enter
    PTY-->>PY: exit 0
    PY->>PY: assert_theme_written(second_theme)

    Note over PY,PTY: Ctrl-P navigation
    PY->>PTY: pty.fork → +list-themes
    PTY-->>PY: render (waits for Enter apply)
    PY->>PTY: send Ctrl-N + Ctrl-P + Enter
    PTY-->>PY: exit 0
    PY->>PY: assert_theme_written(first_theme)

    PY->>Test: write results_path
    Test->>Test: verify config file structure
Loading

Reviews (3): Last reviewed commit: "test: time out theme list discovery" | Re-trigger Greptile

Comment thread tests/test_bundled_ghostty_theme_picker_helper.sh
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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@tests/test_bundled_ghostty_theme_picker_helper.sh`:
- Around line 117-124: The subprocess.run call that sets plain_result (invoking
[helper_path, "+list-themes", "--plain"] with
env=helper_environment(config_path)) can block and hang CI; add a timeout
parameter to that subprocess.run invocation (e.g., timeout=<reasonable_seconds>)
and handle subprocess.TimeoutExpired by failing the test with a clear message or
raising the exception so the test suite does not hang indefinitely.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d373d83a-01f7-4697-9846-df89ccdd9f1b

📥 Commits

Reviewing files that changed from the base of the PR and between 296060b and f283c43.

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

Comment thread tests/test_bundled_ghostty_theme_picker_helper.sh Outdated
@lawrencecchen lawrencecchen force-pushed the followup-themes-main-full branch from f283c43 to 1d9b4b1 Compare May 21, 2026 09:23
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.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="ghostty">

<violation number="1" location="ghostty:1">
P2: Submodule commit `176bd550f6fedd29e85cd92470e5dfadf295ebf7` is not on the fork's `main` branch, violating the repository convention that submodule commits must be pushed to main before updating the parent pointer. The commit is only on feature branch `issue-themes-broken-ctrl-np`, which could become unreachable if that branch is deleted. Push the commit to the fork's `main` branch (or merge it) before updating the parent submodule pointer.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread ghostty
@@ -1 +1 @@
Subproject commit ff6e1260d2e7767de55b8d9307b328e4060545b7
Subproject commit 176bd550f6fedd29e85cd92470e5dfadf295ebf7
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Submodule commit 176bd550f6fedd29e85cd92470e5dfadf295ebf7 is not on the fork's main branch, violating the repository convention that submodule commits must be pushed to main before updating the parent pointer. The commit is only on feature branch issue-themes-broken-ctrl-np, which could become unreachable if that branch is deleted. Push the commit to the fork's main branch (or merge it) before updating the parent submodule pointer.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At ghostty, line 1:

<comment>Submodule commit `176bd550f6fedd29e85cd92470e5dfadf295ebf7` is not on the fork's `main` branch, violating the repository convention that submodule commits must be pushed to main before updating the parent pointer. The commit is only on feature branch `issue-themes-broken-ctrl-np`, which could become unreachable if that branch is deleted. Push the commit to the fork's `main` branch (or merge it) before updating the parent submodule pointer.</comment>

<file context>
@@ -1 +1 @@
-Subproject commit ff6e1260d2e7767de55b8d9307b328e4060545b7
+Subproject commit 176bd550f6fedd29e85cd92470e5dfadf295ebf7
</file context>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid dependency ordering issue. I retargeted manaflow-ai/ghostty#60 to main; this parent PR should merge only after that Ghostty PR is merged following dogfood approval.

— Claude Code

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for confirming and handling the merge order.

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.

♻️ Duplicate comments (1)
tests/test_bundled_ghostty_theme_picker_helper.sh (1)

117-124: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a timeout to plain-mode theme discovery.

At Line 117, subprocess.run can block indefinitely if +list-themes --plain hangs, which can stall CI before the PTY timeout path is reached.

Suggested patch
-plain_result = subprocess.run(
-    [helper_path, "+list-themes", "--plain"],
-    check=True,
-    env=helper_environment(config_path),
-    stdout=subprocess.PIPE,
-    stderr=subprocess.PIPE,
-    text=True,
-)
+try:
+    plain_result = subprocess.run(
+        [helper_path, "+list-themes", "--plain"],
+        check=True,
+        env=helper_environment(config_path),
+        stdout=subprocess.PIPE,
+        stderr=subprocess.PIPE,
+        text=True,
+        timeout=10,
+    )
+except subprocess.TimeoutExpired:
+    sys.stderr.write("FAIL: timed out while listing bundled themes in plain mode\n")
+    sys.exit(1)
🤖 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 `@tests/test_bundled_ghostty_theme_picker_helper.sh` around lines 117 - 124,
The subprocess.run call that captures plain-mode theme discovery (plain_result)
should include a timeout to avoid hanging CI; add a timeout argument (e.g.,
timeout=30) to the subprocess.run invocation that uses helper_path with
"+list-themes" and helper_environment(config_path), and also catch
subprocess.TimeoutExpired around that call to fail the test with a clear
message/diagnostic rather than blocking indefinitely.
🤖 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.

Duplicate comments:
In `@tests/test_bundled_ghostty_theme_picker_helper.sh`:
- Around line 117-124: The subprocess.run call that captures plain-mode theme
discovery (plain_result) should include a timeout to avoid hanging CI; add a
timeout argument (e.g., timeout=30) to the subprocess.run invocation that uses
helper_path with "+list-themes" and helper_environment(config_path), and also
catch subprocess.TimeoutExpired around that call to fail the test with a clear
message/diagnostic rather than blocking indefinitely.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d6552920-9b32-4f77-99db-d2a5492d106f

📥 Commits

Reviewing files that changed from the base of the PR and between f283c43 and 1d9b4b1.

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

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