From 57dfaa63caf1c0834d6d9fd3a1f9c8ad3e0ee29c Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Tue, 7 Jan 2025 17:04:54 +0000 Subject: [PATCH] emacs: Fix using emacs in embedded terminal (#22779) - Follow-up to: https://github.com/zed-industries/zed/pull/22590 Release Notes: - N/A --- assets/keymaps/macos/emacs.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/keymaps/macos/emacs.json b/assets/keymaps/macos/emacs.json index fed6f79d471594bcc78911fcb17da2f652035cee..2060189334c1dc753639ab3e860d6c4841c99ba7 100755 --- a/assets/keymaps/macos/emacs.json +++ b/assets/keymaps/macos/emacs.json @@ -55,7 +55,7 @@ } }, { - "context": "Workspace && !Terminal", + "context": "Workspace", "bindings": { "ctrl-x ctrl-c": "zed::Quit", // save-buffers-kill-terminal "ctrl-x 5 0": "workspace::CloseWindow", // delete-frame @@ -72,6 +72,18 @@ "ctrl-x s": "workspace::SaveAll" // save-some-buffers } }, + { + // Workaround to enable using emacs in the Zed terminal. + // Unbind so Zed ignores these keys and lets emacs handle them. + "context": "Terminal", + "bindings": { + "ctrl-x ctrl-c": null, // save-buffers-kill-terminal + "ctrl-x ctrl-f": null, // find-file + "ctrl-x ctrl-s": null, // save-buffer + "ctrl-x ctrl-w": null, // write-file + "ctrl-x s": null // save-some-buffers + } + }, { "context": "BufferSearchBar > Editor", "bindings": {