[BUG] /terminal-setup falsely detects ctrl+shift+enter as shift+enter in Kitty
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Description
The /terminal-setup command uses a naive substring search for detecting existing shift+enter keybindings. This causes false positives when ctrl+shift+enter is configured (a completely different key combination).
## Steps to Reproduce
- Have this in
~/.config/kitty/kitty.conf:
map ctrl+shift+enter launch --location=hsplit
- Run
/terminal-setupin Claude Code - Get error: "Found existing Kitty Shift+Enter key binding. Remove it to continue."
## Expected Behavior
ctrl+shift+enter should NOT trigger the detection since it's a different key combination than shift+enter.
## Actual Behavior
The substring "shift+enter" within "ctrl+shift+enter" triggers the false positive.
## Environment
- Claude Code version: 2.0.76
- Terminal: Kitty
- OS: NixOS (Linux)
## Suggested Fix
Use proper pattern matching that distinguishes between:
map shift+enter(should match)map ctrl+shift+enter(should NOT match)
Example regex: /^\s*map\s+shift\+enter\s/ instead of substring search.
## Related Issues
- #10461 - Same root cause (naive string search) affecting Ghostty
What Should Happen?
ctrl+shift+enter should NOT trigger the shift+enter detection since it's a different key combination. The terminal-setup command should only match exact shift+enter bindings, not bindings that contain "shift+enter" as a substring.
Error Messages/Logs
Found existing Kitty Shift+Enter key binding. Remove it to continue.
See /home/username/.config/kitty/kitty.conf
Steps to Reproduce
- Have
map ctrl+shift+enter launch --location=hsplitin ~/.config/kitty/kitty.conf - Run
/terminal-setupin Claude Code - 3. Get false positive error about existing shift+enter binding
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗