[Bug] `/terminal-setup` overwrites entire keymap.json instead of merging bindings
Bug Description
/terminal-setup overwrites the entire Zed keymap.json instead of merging
▎
▎ Claude Code 2.1.220, Zed 1.12.1, macOS (Darwin 25.5.0)
▎
▎ Running /terminal-setup replaced the whole of ~/.config/zed/keymap.json with a single block containing only the shift-enter binding:
▎
▎ [{ "context": "Terminal", "bindings": { "shift-enter": ["terminal::SendText", "\^[\r"] } }]
▎
▎ The file went from 2112 bytes / 8 binding blocks to 143 bytes / 1. Everything else was silently dropped — vim-mode leader-key LSP bindings, ctrl-h/j/k/l pane navigation, ctrl-/ → workspace::NewCenterTerminal, cmd-shift-w, ctrl-enter zoom, a shift-escape unbind, ctrl-cmd-r.
▎
▎ A backup was written to keymap.json.cc74536b.bak, which is the only reason it was recoverable — but nothing in the output said the file had been rewritten or that a backup existed, so the loss only surfaced later when a keybinding stopped working.
▎
▎ Expected: append or merge the shift-enter block into the existing array, leaving other blocks untouched. Zed's keymap is JSON5 (comments, trailing commas), so a naive JSON.parse → serialize round-trip would also strip comments — a targeted append is safer than a reserialize.
▎
▎ Also: if a matching shift-enter binding already exists, no write at all.
Environment Info
- Platform: darwin
- Terminal: zed
- Version: 2.1.220
- Feedback ID: f27fc0b0-3d78-414e-a92a-0f4142edb6df
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗