Skip to content

Fix cmux theme picker Enter from search - #3378

Merged
lawrencecchen merged 2 commits into
mainfrom
task-themes-enter-apply
May 1, 2026
Merged

lawrencecchen merged 2 commits into
mainfrom
task-themes-enter-apply

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add PTY coverage for cmux themes applying from picker search mode with Enter.
  • Bump the Ghostty fork to apply the filtered selection on Enter from search mode.
  • Pin and verify the GhosttyKit artifact for the new Ghostty SHA.

Testing

  • bash -n tests/test_bundled_ghostty_theme_picker_helper.sh
  • ./scripts/reload.sh --tag thmenter
  • GHOSTTY_SHA=4265d34282ce2023c27da851c454dabe6cdc76ce GHOSTTYKIT_OUTPUT_DIR=<tmp>/GhosttyKit.xcframework ./scripts/download-prebuilt-ghosttykit.sh

Issues

Summary by CodeRabbit

  • Documentation

    • Clarified theme picker search mode behavior: pressing Enter applies the filtered selection and exits; Escape cancels.
  • Chores

    • Updated Ghostty dependency to latest version.
  • Tests

    • Added test coverage for theme picker search mode scenarios.

@vercel

vercel Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Apr 30, 2026 11:54pm
cmux-staging Building Building Preview, Comment Apr 30, 2026 11:54pm

@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 19982e4e-2b65-4bc9-9f49-198608f4b1d2

📥 Commits

Reviewing files that changed from the base of the PR and between 7d05eba and f61f9b6.

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

📝 Walkthrough

Walkthrough

Updates the pinned Ghostty fork revision and cmux theme picker search-mode Enter behavior documentation. Adjusts GhosttyKit checksum mapping. Refactors theme picker test harness to validate both normal and search mode scenarios with additional configuration paths.

Changes

Cohort / File(s) Summary
Ghostty Submodule & Documentation
docs/ghostty-fork.md, ghostty
Updated Ghostty fork pin to commit 4265d3428. Refined cmux theme picker description for search-mode Enter behavior (applies filtered selection, exits with apply outcome). Added merge-conflict notes and April 30, 2026 verification bullets; clarified Escape cancellation and normal-mode Enter behavior.
GhosttyKit Checksums
scripts/ghosttykit-checksums.txt
Appended new checksum entry mapping submodule SHA 4265d34282ce2023c27da851c454dabe6cdc76ce to SHA256 ff97867882e922037158b4ee55c460be86ba2c81c85f66f43815a7b9e8f60149.
Theme Picker Test Harness
tests/test_bundled_ghostty_theme_picker_helper.sh
Refactored Python harness into reusable run_picker function. Added SEARCH_CONFIG_PATH and RESULTS_PATH exports. Executes two test scenarios: normal mode (Enter key, original config) and search mode (/tokyo+Enter, search-specific config). Shell verification now validates marker/theme contents across all config paths in results file instead of single path.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A fork is pinned, a checksum rings,
Search mode Enter now applies all things!
Two scenarios dance, their paths align,
The picker verifies, line by line. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: fixing theme picker behavior when pressing Enter from search mode in cmux.
Description check ✅ Passed The description covers the required sections (Summary, Testing, Issues) with specific details about changes, testing commands, and related issues/PRs, though it omits the optional Demo Video and Checklist sections.
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.

✏️ 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 task-themes-enter-apply

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
Review rate limit: 5/8 reviews remaining, refill in 21 minutes and 10 seconds.

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

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

@greptile-apps

greptile-apps Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the cmux theme picker failing to apply a theme when Enter is pressed from search mode. It bumps the Ghostty submodule to the new fork commit 4265d3428 (on branch fix-cmux-theme-search-enter), pins its GhosttyKit artifact checksum, updates the fork documentation, and extends the PTY integration test to cover the search-mode Enter path alongside the existing normal-mode scenario.

Confidence Score: 4/5

Safe to merge; changes are a targeted fork bump with accompanying test coverage and documentation — no logic regressions expected.

All four changed files are consistent with each other: the submodule SHA, checksum file, documentation, and test all agree on the new Ghostty commit. The refactored test correctly exercises both normal-mode and search-mode Enter paths. Only minor P2 observations (hardcoded search term, shared trigger condition) prevent a perfect score.

tests/test_bundled_ghostty_theme_picker_helper.sh — the search-mode scenario relies on 'tokyo' matching at least one bundled theme; worth a quick sanity-check if themes are ever pruned.

Important Files Changed

Filename Overview
tests/test_bundled_ghostty_theme_picker_helper.sh Refactored the PTY test into a reusable run_picker() function and added a second scenario that drives the picker into search mode with /tokyo\r before pressing Enter; adds new SEARCH_CONFIG_PATH/RESULTS_PATH exports and a shell loop to verify both output files.
docs/ghostty-fork.md Updated fork documentation: new pinned SHA 4265d34, branch changed from main to fix-cmux-theme-search-enter, added changelog and conflict notes for the search-mode Enter fix.
ghostty Submodule bumped from 04ec691 to 4265d34 to pick up the search-mode Enter fix in the cmux Ghostty fork.
scripts/ghosttykit-checksums.txt Appended the checksum for the new GhosttyKit artifact keyed by the new Ghostty SHA 4265d34.

Sequence Diagram

sequenceDiagram
    participant Shell as test script (bash)
    participant PY as Python PTY harness
    participant PTY as PTY master fd
    participant GH as ghostty +list-themes

    Shell->>PY: run_picker("normal mode", config_path, CR)
    PY->>GH: pty.fork() + execve
    GH-->>PTY: renders picker UI ("Enter apply" visible)
    PTY-->>PY: output accumulates
    PY->>PTY: write(CR) on "Enter apply" trigger
    GH-->>PTY: writes config_path, exits 0
    PY-->>Shell: returns (success)

    Shell->>PY: run_picker("search mode", search_config_path, "/tokyo\r")
    PY->>GH: pty.fork() + execve
    GH-->>PTY: renders picker UI ("Enter apply" visible)
    PTY-->>PY: output accumulates
    PY->>PTY: write("/tokyo\r") on "Enter apply" trigger
    Note over PTY,GH: "/" enters search mode, "tokyo" filters list, CR applies selection
    GH-->>PTY: writes search_config_path, exits 0
    PY-->>Shell: returns (success)

    Shell->>Shell: write results_path listing both config paths
    loop for each path in results_path
        Shell->>Shell: assert file exists
        Shell->>Shell: grep cmux themes start/end markers
        Shell->>Shell: grep theme = light:...,dark:...
    end
    Shell->>Shell: echo PASS
Loading

Reviews (1): Last reviewed commit: "Apply cmux theme from picker search" | Re-trigger Greptile



run_picker("normal mode", config_path, b"\r")
run_picker("search mode", search_config_path, b"/tokyo\r")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Hardcoded search term could produce 0 results silently

b"/tokyo\r" assumes at least one bundled theme name contains "tokyo". If the theme list is ever reorganised and no match exists, Enter on an empty filtered list may not write the override file — the test would then fail on the existence check, which is the right outcome, but there is no signal about why it failed. A comment explaining the chosen term (e.g. "tokyo matches 'Tokyo Night' and variants, confirmed present in bundled themes") would make future regressions easier to diagnose.

Comment on lines +129 to +131
if not sent_input and b"Enter apply" in output:
os.write(master_fd, scripted_input)
sent_input = True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Trigger condition shared between normal-mode and search-mode scenarios

Both run_picker calls use the same trigger: b"Enter apply" in output. For the search-mode scenario this is fine because "Enter apply" appears in the initial footer before / is sent. However, if a future Ghostty version changes the footer text in search mode (e.g. to "Enter apply search result"), the trigger would still fire on the initial normal-mode text — making the test structurally valid but potentially masking a regression. Accepting a trigger parameter alongside scripted_input would make each scenario's intent explicit.

@lawrencecchen
lawrencecchen merged commit 0ff6bf0 into main May 1, 2026
23 checks passed
@lawrencecchen
lawrencecchen deleted the task-themes-enter-apply branch May 1, 2026 00:11

This branch was successfully deployed

1 active deployment
Preview – cmux — f61f9b64 Deployed Apr 30, 2026 by vercel[bot]
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