Fix copy shortcut in macOS notebook cells - #59431
Merged
Merged
Conversation
Remove all bindings of `notebook::InterruptKernel` for the `NotebookEditor > Editor` context. The original change was simply updating the default macOS keymap to use `ctrl-c` instead of `cmd-c` in order to avoid breaking copy behavior while focused on an editor. Although this was fine for macOS, the issue would still be present on both Windows and Linux, where `ctrl-c` is bound to `editor::Copy` by default, but was now bound to `notebook::InterruptKernel` on `NotebookEditor > Editor`. As such, in order to avoid this issue in any platform, this commit removes any of the `cmd-c`/`ctrl-c` binds to `notebook::InterruptKernel` in the `NotebookEditor > Editor` in order for it to match the default `Editor` context instead and simply copy the selection if the user is focused on an editor.
dinocosta
approved these changes
Jun 16, 2026
dinocosta
left a comment
Member
There was a problem hiding this comment.
Hi @ChengranAA ! Thank you for finding and attempting to fix this 🙂
Although the changes were good on macOS, the issue would still be present on both Windows and Linux, as those platforms rely on ctrl-c for copying. I've updated the changes to remove any cmd-c/ctrl-c binding in the NotebookEditor > Editor context, which will let it match on the default Editor context and ensure copy works on any platform, if the user is on a notebook but focused on an editor.
Thanks!
dinocosta
enabled auto-merge
June 16, 2026 15:46
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
Fix `cmd-c` not copying text inside macOS notebook cell editors. Previously, the macOS notebook keymap bound `cmd-c` to `notebook::InterruptKernel` in notebook contexts, including `NotebookEditor > Editor`. This shadowed the normal editor copy shortcut while editing notebook cells. ## Solution Move the macOS notebook interrupt shortcut from `cmd-c` to `ctrl-c`. This keeps the notebook interrupt shortcut available while allowing the normal editor keybindings to handle: - `cmd-c` for copy - `cmd-x` for cut - `cmd-v` for paste inside notebook cell editors. - This change is macOS-specific. Release Notes: - N/A --------- Co-authored-by: dino <dinojoaocosta@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
cmd-cnot copying text inside macOS notebook cell editors.Previously, the macOS notebook keymap bound
cmd-ctonotebook::InterruptKernelin notebook contexts, includingNotebookEditor > Editor. This shadowed the normal editor copy shortcut while editing notebook cells.Solution
Move the macOS notebook interrupt shortcut from
cmd-ctoctrl-c.This keeps the notebook interrupt shortcut available while allowing the normal editor keybindings to handle:
cmd-cfor copycmd-xfor cutcmd-vfor pasteinside notebook cell editors.
Release Notes: