From 71f5dbdf26f5152ea32fca4675678593f7e183e6 Mon Sep 17 00:00:00 2001 From: Justin Su Date: Wed, 22 Apr 2026 06:50:48 -0400 Subject: [PATCH] Fix ctrl-delete keybind in the terminal (#51726) showkey in Ghostty, iTerm2, and Terminal.app reports ctrl-delete as `[3;5~`. I tested this keybind on macOS, where fish_key_reader correctly interprets it as ctrl-delete. Closes #51725 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: - Fixed ctrl-delete keybind in the terminal --------- Co-authored-by: Jakub Konka --- assets/keymaps/default-linux.json | 2 +- assets/keymaps/default-macos.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index 280e14f13ca880cfe8a89a47b1acdea3ee050586..af1fb028436417da43470b08c6ad718f7d587237 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -1209,7 +1209,7 @@ "alt-b": ["terminal::SendText", "\u001bb"], "alt-f": ["terminal::SendText", "\u001bf"], "alt-.": ["terminal::SendText", "\u001b."], - "ctrl-delete": ["terminal::SendText", "\u001bd"], + "ctrl-delete": ["terminal::SendText", "\u001b[3;5~"], // Overrides for conflicting keybindings "ctrl-b": ["terminal::SendKeystroke", "ctrl-b"], "ctrl-c": ["terminal::SendKeystroke", "ctrl-c"], diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index 7c56b433792389c27358e848c2d1c838219068fc..23953b9d45cc9c9980a4eac73293195750a1c073 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -1278,7 +1278,7 @@ "alt-right": ["terminal::SendText", "\u001bf"], "alt-b": ["terminal::SendText", "\u001bb"], "alt-f": ["terminal::SendText", "\u001bf"], - "ctrl-delete": ["terminal::SendText", "\u001bd"], + "ctrl-delete": ["terminal::SendText", "\u001b[3;5~"], // There are conflicting bindings for these keys in the global context. // these bindings override them, remove at your own risk: "up": ["terminal::SendKeystroke", "up"],