Skip to content

Fix Cmd+Shift+Enter not zooming pane when browser is focused - #826

Merged
lawrencecchen merged 1 commit into
mainfrom
task-cmd-shift-enter-hide-left-terminal
Mar 4, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
task-cmd-shift-enter-hide-left-terminal

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Make browser Return/Enter keyDown forwarding modifier-aware so it only routes submit-intent keys (Return / Shift+Return)
  • Preserve app-level shortcuts for command-modified Return, which restores Cmd+Shift+Enter pane zoom behavior when browser content is focused
  • Add regression tests for Enter routing with command, command+shift, option, and control modifiers

Testing

  • xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux-unit -configuration Debug -destination 'platform=macOS' -only-testing:cmuxTests/BrowserReturnKeyDownRoutingTests test (pass)
  • xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -destination 'platform=macOS' build (pass)
  • scripts/codex-review.sh /Users/lawrencechen/fun/cmuxterm-hq/worktrees/task-cmd-shift-enter-hide-left-terminal (0 findings)

Issues

  • Task reference: cmd+shift+enter is failing to hide left terminal (HQ task request, no GitHub issue URL)

Summary by cubic

Restores Cmd+Shift+Enter pane zoom when a browser view is focused by making Return key routing modifier-aware. This addresses the task where Cmd+Shift+Enter failed to hide the left terminal.

  • Bug Fixes
    • Only forward plain and Shift Return from the browser; keep Command‑modified Return for app shortcuts (e.g., Toggle Pane Zoom).
    • Added unit tests for Return routing with command, command+shift, option, and control.

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

@vercel

vercel Bot commented Mar 4, 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 Mar 4, 2026 2:24am

@coderabbitai

coderabbitai Bot commented Mar 4, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@lawrencecchen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 56 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Run ID: fc6543cf-9ecf-4c2b-9c99-773c419e7074

📥 Commits

Reviewing files that changed from the base of the PR and between fd31210 and c3dfc39.

📒 Files selected for processing (2)
  • Sources/AppDelegate.swift
  • cmuxTests/CmuxWebViewKeyEquivalentTests.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch task-cmd-shift-enter-hide-left-terminal

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

@greptile-apps

greptile-apps Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixed Cmd+Shift+Enter pane zoom regression by making browser Return key forwarding modifier-aware, ensuring only plain Return and Shift+Return are routed to browser content for form submission while preserving app-level keyboard shortcuts.

  • Modified shouldDispatchBrowserReturnViaFirstResponderKeyDown to check modifier flags and only forward submit-intent keys (plain Return or Shift+Return)
  • Command-modified Return keys (Cmd+Shift+Enter, Cmd+Enter) now properly bubble up to app shortcuts instead of being consumed by the browser
  • Added 5 regression tests covering Return routing with command, shift, option, and control modifiers

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is surgical and well-tested, with comprehensive regression tests covering all modifier combinations. The change preserves backward compatibility for form submission (plain Return and Shift+Return) while correctly fixing the keyboard shortcut handling bug. Logic is straightforward with clear comments explaining the intent.
  • No files require special attention

Important Files Changed

Filename Overview
Sources/AppDelegate.swift Added modifier-awareness to browser Return key routing to preserve app-level shortcuts
cmuxTests/CmuxWebViewKeyEquivalentTests.swift Added comprehensive regression tests for Return key routing with various modifier combinations

Last reviewed commit: c3dfc39

@lawrencecchen
lawrencecchen merged commit a139c34 into main Mar 4, 2026
13 checks passed
@lawrencecchen
lawrencecchen deleted the task-cmd-shift-enter-hide-left-terminal branch March 4, 2026 02:37
bn-l pushed a commit to bn-l/cmux that referenced this pull request Apr 3, 2026

This branch was successfully deployed

1 active deployment
Preview — c3dfc39d Deployed Mar 4, 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