[BUG] Kitty keyboard protocol sequences display as literal '<' and '<%' in JetBrains JediTerm (IntelliJ/WebStorm)
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
When running Claude Code in any JetBrains IDE terminal (JediTerm), two escape
sequences leak as visible characters on every claude launch:
<appears at the top of the splash screen<%appears at the bottom after exit
This was previously reported in #18135 but closed as stale without a fix.
Environment
- Claude Code version: 2.1.107
- IDE: IntelliJ IDEA
- Terminal: JetBrains-JediTerm
- OS: macOS (Apple Silicon)
- Shell: zsh
Steps to Reproduce
- Open any JetBrains IDE built-in terminal
- Run
claude - Observe
<before the splash screen - Run
/exit - Observe
<%after exit
Root Cause (confirmed via script capture)
Two sequences leak because JediTerm doesn't handle them:
^[[>0q(XTVERSION request) → leaks<^[[c(DA1 Device Attributes) → leaks<%
Attempted Workarounds — none worked
TERM_PROGRAM=JetBrains-JediTermCLAUDE_NO_KITTY_KEYBOARD=1TERM=xterm
Proposed Fix
JediTerm automatically sets TERMINAL_EMULATOR=JetBrains-JediTerm in its
environment. Claude Code could detect this and skip the Kitty keyboard protocol
and DA1 query for that terminal.
What Should Happen?
No stray characters should appear. The escape sequences should be
handled silently by Claude Code when running inside JediTerm.
Error Messages/Logs
^[[>0q (leaks '<')
^[[c (leaks '<%')
Steps to Reproduce
- Open any JetBrains IDE built-in terminal (IntelliJ, WebStorm, etc.)
- Run
claude - Observe
<displayed before the splash screen - Type
/exit - Observe
<%displayed after exit
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.107
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
Previously reported in #18135, closed as stale without a fix.
Root cause confirmed via script capture — two sequences leak because
JediTerm doesn't handle them silently.
JediTerm automatically sets TERMINAL_EMULATOR=JetBrains-JediTerm in the
environment, which Claude Code could use for detection.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗