claude-code - 💡(How to fix) Fix [BUG] Kitty keyboard protocol sequences display as literal '<' and '<%' in JetBrains JediTerm (IntelliJ/WebStorm) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48212Fetched 2026-04-15 06:30:01
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1

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.

Error Message

Error Messages/Logs

Root Cause

Root Cause (confirmed via script capture)

Two sequences leak because JediTerm doesn't handle them:

  • ^[[>0q (XTVERSION request) → leaks <
  • ^[[c (DA1 Device Attributes) → leaks <%

Fix Action

Fix / Workaround

Attempted Workarounds — none worked

  • TERM_PROGRAM=JetBrains-JediTerm
  • CLAUDE_NO_KITTY_KEYBOARD=1
  • TERM=xterm

Code Example

^[[>0q  (leaks '<')
^[[c    (leaks '<%')
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. Open any JetBrains IDE built-in terminal
  2. Run claude
  3. Observe < before the splash screen
  4. Run /exit
  5. 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-JediTerm
  • CLAUDE_NO_KITTY_KEYBOARD=1
  • TERM=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

  1. Open any JetBrains IDE built-in terminal (IntelliJ, WebStorm, etc.)
  2. Run claude
  3. Observe < displayed before the splash screen
  4. Type /exit
  5. 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.

extent analysis

TL;DR

Detecting the TERMINAL_EMULATOR=JetBrains-JediTerm environment variable in Claude Code to skip the Kitty keyboard protocol and DA1 query may resolve the issue.

Guidance

  • Check if the TERMINAL_EMULATOR environment variable is set to JetBrains-JediTerm when running Claude Code in a JetBrains IDE terminal.
  • Modify Claude Code to detect this environment variable and conditionally skip the XTVERSION request and DA1 Device Attributes queries.
  • Verify that the escape sequences ^[[>0q and ^[[c are handled silently by Claude Code when running inside JediTerm.
  • Test the proposed fix by running Claude Code in a JetBrains IDE terminal and observing if the stray characters < and <% are no longer displayed.

Example

if [ "$TERMINAL_EMULATOR" = "JetBrains-JediTerm" ]; then
  # Skip Kitty keyboard protocol and DA1 query
  # ...
fi

Notes

The proposed fix relies on detecting the TERMINAL_EMULATOR environment variable, which may not be set in all cases. Additional testing and verification are necessary to ensure the fix works as expected.

Recommendation

Apply the workaround by detecting the TERMINAL_EMULATOR environment variable and skipping the Kitty keyboard protocol and DA1 query, as this approach directly addresses the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING