opencode
opencode copied to clipboard
fix: Allow ctrl+space to work as leader key
What does this PR do?
Closes #3657 (which should have been re-opened)
Summary
- Normalize ParsedKey events so ctrl+space (NUL) and ctrl+_ map to named keys in one place, and simplify key parsing to rely on that normalization (packages/opencode/src/util/keybind.ts:13, packages/opencode/src/cli/cmd/tui/context/keybind.tsx:76).
- Add a focused unit test that fails pre-fix by asserting NUL maps to ctrl+space (packages/opencode/test/keybind.test.ts:190).
How did you verify your code works?
Tested locally and added test for key detection. Test verified failing before src changes.