Skip to content

Conversation

Copy link

Copilot AI commented Oct 27, 2025

Tab navigation shortcuts (Ctrl+W, Ctrl+PageUp/Down) were intercepted by CodeMirror's textarea and never reached the global Mousetrap handlers. Other shortcuts like Ctrl+PageUp/Down for tab switching also failed when focus was in any editor field.

Changes

Added pass-through configuration for tab navigation shortcuts in all CodeMirror editor components:

  • CodeEditor - Request body editor (JSON, XML, text, SPARQL)
  • SingleLineEditor - Headers, params, environment variables
  • MultiLineEditor - Multi-line inputs
  • QueryEditor - GraphQL queries

Each editor's extraKeys now returns CodeMirror.Pass for these shortcuts, allowing events to propagate to global handlers:

extraKeys: {
  // ... existing keys ...
  'Cmd-W': () => CodeMirror.Pass,
  'Ctrl-W': () => CodeMirror.Pass,
  'Cmd-PageUp': () => CodeMirror.Pass,
  'Ctrl-PageUp': () => CodeMirror.Pass,
  'Cmd-PageDown': () => CodeMirror.Pass,
  'Ctrl-PageDown': () => CodeMirror.Pass
}

This follows the existing pattern used for disabling Tab key (Tab: false) and allows Ctrl+S to continue working as explicitly handled in extraKeys.

Original prompt

This section details on the original issue you should resolve

<issue_title>ctrl+w to close tab does not work when focus is in request body field</issue_title>
<issue_description>### I have checked the following:

  • I have searched existing issues and found nothing related to my issue.

This bug is:

  • making Bruno unusable for me
  • slowing me down but I'm able to continue working
  • annoying
  • this feature was working in a previous version but is broken in the current release.

Bruno version

2.13.2

Operating System

Windows 11

Describe the bug

When the focus is on the request body input field, the shortcut CTRL+w does not work. After clicking somewhere else in the GUI so that the input field looses the focue, CTRL+w works again and closes the tab.

This behaviour can be reproduced for other shortcuts like CTRL+page up and down as well.
Interestingly it DOES work fine for CTRL+s to save any changes in the request.

.bru file to reproduce the bug

No response

Screenshots/Live demo link

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix CTRL+w shortcut not closing tab in request body field Fix keyboard shortcuts not working in CodeMirror editor fields Oct 27, 2025
Copilot finished work on behalf of Pragadesh44-Bruno October 27, 2025 08:55
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot completely remove the changes from the package-lock.json since it is irrelevant to the fix for this issue

Copy link
Author

Choose a reason for hiding this comment

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

Reverted package-lock.json changes in commit 7fda0fc.

Comment on lines 138 to 145
'Cmd-PageUp': () => CodeMirror.Pass,
'Ctrl-PageUp': () => CodeMirror.Pass,
'Cmd-PageDown': () => CodeMirror.Pass,
'Ctrl-PageDown': () => CodeMirror.Pass,
'Cmd-Shift-PageUp': () => CodeMirror.Pass,
'Ctrl-Shift-PageUp': () => CodeMirror.Pass,
'Cmd-Shift-PageDown': () => CodeMirror.Pass,
'Ctrl-Shift-PageDown': () => CodeMirror.Pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot remove these lines. it is irrelevant to this issue

Copy link
Author

Choose a reason for hiding this comment

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

Removed Shift+W and Shift+PageUp/Down shortcuts in commit 7fda0fc. Only kept Ctrl+W and Ctrl+PageUp/Down as mentioned in the issue.

Comment on lines 71 to 78
'Cmd-PageUp': () => CodeMirror.Pass,
'Ctrl-PageUp': () => CodeMirror.Pass,
'Cmd-PageDown': () => CodeMirror.Pass,
'Ctrl-PageDown': () => CodeMirror.Pass,
'Cmd-Shift-PageUp': () => CodeMirror.Pass,
'Ctrl-Shift-PageUp': () => CodeMirror.Pass,
'Cmd-Shift-PageDown': () => CodeMirror.Pass,
'Ctrl-Shift-PageDown': () => CodeMirror.Pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot remove these lines. it is irrelevant to this issue

Copy link
Author

Choose a reason for hiding this comment

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

Removed Shift+W and Shift+PageUp/Down shortcuts in commit 7fda0fc.

Comment on lines 135 to 144
'Cmd-Shift-W': () => CodeMirror.Pass,
'Ctrl-Shift-W': () => CodeMirror.Pass,
'Cmd-PageUp': () => CodeMirror.Pass,
'Ctrl-PageUp': () => CodeMirror.Pass,
'Cmd-PageDown': () => CodeMirror.Pass,
'Ctrl-PageDown': () => CodeMirror.Pass,
'Cmd-Shift-PageUp': () => CodeMirror.Pass,
'Ctrl-Shift-PageUp': () => CodeMirror.Pass,
'Cmd-Shift-PageDown': () => CodeMirror.Pass,
'Ctrl-Shift-PageDown': () => CodeMirror.Pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot remove these lines. it is irrelevant to this issue

Copy link
Author

Choose a reason for hiding this comment

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

Removed Shift+W and Shift+PageUp/Down shortcuts in commit 7fda0fc.

Comment on lines 80 to 88
'Cmd-PageUp': () => CodeMirror.Pass,
'Ctrl-PageUp': () => CodeMirror.Pass,
'Cmd-PageDown': () => CodeMirror.Pass,
'Ctrl-PageDown': () => CodeMirror.Pass,
'Cmd-Shift-PageUp': () => CodeMirror.Pass,
'Ctrl-Shift-PageUp': () => CodeMirror.Pass,
'Cmd-Shift-PageDown': () => CodeMirror.Pass,
'Ctrl-Shift-PageDown': () => CodeMirror.Pass
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot remove these lines. it is irrelevant to this issue

Copy link
Author

Choose a reason for hiding this comment

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

Removed Shift+W and Shift+PageUp/Down shortcuts in commit 7fda0fc.

Copilot finished work on behalf of Pragadesh44-Bruno October 27, 2025 09:12
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.

ctrl+w to close tab does not work when focus is in request body field

2 participants