Skip to content

fix: prevent Cmd/Ctrl+Enter from adding newline when sending requests - #7845

Closed
phubadeepjs wants to merge 1 commit into
usebruno:mainfrom
phubadeepjs:bugfix/cmd-enter-send-no-newline
Closed

phubadeepjs wants to merge 1 commit into
usebruno:mainfrom
phubadeepjs:bugfix/cmd-enter-send-no-newline

Conversation

@phubadeepjs

@phubadeepjs phubadeepjs commented Apr 23, 2026 •

Copy link
Copy Markdown

Description

Handle Cmd/Ctrl+Enter directly in editors and stop event propagation in the request tab hotkey so sending a request does not also insert a new line.

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • [] I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • New Features
    • Added keyboard shortcuts (Cmd-Enter on Mac, Ctrl-Enter on Linux/Windows) to execute requests and code directly from the editor, streamlining your workflow.
    • Improved keyboard event handling to ensure shortcuts properly trigger execution without interfering with browser behavior.

Handle Cmd/Ctrl+Enter directly in CodeMirror editors and stop event propagation in the request tab hotkey so sending a request does not also insert a new line.

Made-with: Cursor
@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 82addcb7-8b3c-455b-a489-7cd9b66fa076

📥 Commits

Reviewing files that changed from the base of the PR and between 9501a14 and a910e5f.

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/CodeEditor/index.js
  • packages/bruno-app/src/components/MultiLineEditor/index.js
  • packages/bruno-app/src/components/RequestTabPanel/index.js

Walkthrough

Three editor components are updated to add keyboard shortcuts for triggering run actions. CodeEditor and MultiLineEditor now register Cmd-Enter and Ctrl-Enter shortcuts that invoke onRun() callbacks, while RequestTabPanel's sendRequest handler now explicitly prevents default browser behavior and stops event propagation when triggered.

Changes

Cohort / File(s) Summary
Editor Run Shortcuts
packages/bruno-app/src/components/CodeEditor/index.js, packages/bruno-app/src/components/MultiLineEditor/index.js
Added runShortcut handler that triggers onRun() on Cmd-Enter/Ctrl-Enter keypresses, falling back to CodeMirror.Pass when no handler is available.
RequestTabPanel Event Handling
packages/bruno-app/src/components/RequestTabPanel/index.js
Updated sendRequest keybinding handler to accept event parameter and explicitly prevent default behavior and stop propagation before calling handleRun().

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • fix: qol fixes for keybindings #7709: Addresses editor keybinding and shortcut handling across CodeEditor, MultiLineEditor, and Sidebar components with consistent run-action patterns.

Suggested labels

size/M

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno
  • sid-bruno

Poem

⌨️ A keystroke now flows,
Cmd-Enter or Ctrl sends,
Your code runs with grace.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@sid-bruno sid-bruno mentioned this pull request Apr 27, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants