[BUG] Kitty keyboard protocol sequences displayed as '<' in JetBrains JediTerm terminal
Description
When running Claude Code in JetBrains IDEs (WebStorm, IntelliJ, etc.) using the built-in terminal (JediTerm), the Kitty keyboard protocol escape sequences are displayed as literal < characters instead of being interpreted.
Steps to Reproduce
- Open WebStorm (or any JetBrains IDE) terminal
- Run
claude - Observe two
<characters displayed before Claude Code UI appears - Type
/exit - Observe two more
<characters displayed
Expected Behavior
No stray characters should be displayed - the escape sequences should be handled silently.
Actual Behavior
The < character from the Kitty keyboard protocol sequence ESC [ < u (pop keyboard mode) is displayed literally because JediTerm doesn't support this protocol.
Debug Information
Captured via script command:
^[[<u^[[?1004l^[[?2004l...
The ^[[<u sequence is the Kitty keyboard protocol "pop" command that JediTerm doesn't recognize.
Environment
- Claude Code version: 2.1.7
- IDE: WebStorm 2025.3.1.1
- Terminal: JetBrains-JediTerm
- OS: macOS (Darwin 25.2.0)
- TERM: xterm-256color
Proposed Solution
Add an environment variable (e.g., CLAUDE_CODE_DISABLE_KITTY_KEYBOARD=1) to disable the Kitty keyboard protocol, or detect JediTerm via TERMINAL_EMULATOR=JetBrains-JediTerm and automatically disable it.
Workaround Attempted
Setting TERM=xterm does not prevent the Kitty keyboard protocol from being used.
Related
This is similar to focus reporting issues (#10375) where escape sequences leak into the terminal display.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗