From 5c5727c90a56041d1cb18305c82d8364e9d6a587 Mon Sep 17 00:00:00 2001 From: Justin Su Date: Wed, 22 Apr 2026 07:00:04 -0400 Subject: [PATCH] Replace terminal `SendText` ctrl keybinds with `SendKeystroke` (#51728) `SendKeystroke` seems to work for all ctrl keybinds. Prefer it over `SendText` for readability. showkey reports the same key sequences if I apply these keybinds to my user keymap. Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [ ] Done a self-review taking into account security and performance aspects - [ ] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A Co-authored-by: Jakub Konka --- assets/keymaps/default-macos.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index 23953b9d45cc9c9980a4eac73293195750a1c073..7edfd53a73bbf979b6c64cf3b864c6aec450052f 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -1268,11 +1268,11 @@ "ctrl-enter": "assistant::InlineAssist", "ctrl-_": null, // emacs undo // Some nice conveniences - "cmd-backspace": ["terminal::SendText", "\u0015"], // ctrl-u: clear line + "cmd-backspace": ["terminal::SendKeystroke", "ctrl-u"], // clear line "alt-delete": ["terminal::SendText", "\u001bd"], // alt-d: delete word forward - "cmd-delete": ["terminal::SendText", "\u000b"], // ctrl-k: delete to end of line - "cmd-right": ["terminal::SendText", "\u0005"], - "cmd-left": ["terminal::SendText", "\u0001"], + "cmd-delete": ["terminal::SendKeystroke", "ctrl-k"], // delete to end of line + "cmd-right": ["terminal::SendKeystroke", "ctrl-e"], + "cmd-left": ["terminal::SendKeystroke", "ctrl-a"], // Terminal.app compatibility "alt-left": ["terminal::SendText", "\u001bb"], "alt-right": ["terminal::SendText", "\u001bf"],