[BUG] [VS Code extension] ArrowUp during IME composition recalls message history and destroys the text being composed

Status Open
Reported on v2.1.296
Maintainer reply None cached
Activity 0 comments · opened Oct 11, 2026

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?

In the VS Code extension's message input, pressing ↑ while an IME conversion is in progress recalls the previous message from history. The input is replaced with the history entry and the text being composed is lost.

Condition: the composing text starts at the very beginning of the input. The usual case is typing into an empty input. If there is already text before the composing text, it does not happen.

↑ is the standard key for moving to the previous conversion candidate in Japanese IMEs, so this happens during ordinary typing.

What Should Happen?

While an IME composition is active, ↑ / ↓ should be left to the IME: the candidate selection moves and the input is untouched. History recall should only happen when no composition is active.

Error Messages/Logs

keydown received during conversion with the macOS built-in Japanese IME (captured in a minimal contenteditable="plaintext-only" page in Chrome, same check as the extension):
key=ArrowUp keyCode=229 isComposing=true selection start=0 end=3

Before conversion starts (typing only), the same key arrives with start=3 end=3, which is why that case does not trigger the recall.

Steps to Reproduce

  1. Open the Claude Code panel in VS Code and focus the empty message input (at least one earlier message must exist in history).
  2. Switch to the macOS built-in Japanese IME.
  3. Type aaa (あああ) and press Space to start conversion.
  4. Press ↑ to move to the previous candidate.

Result: the input is replaced with the previous message; the composing text is gone.

Note: pressing ↑ right after typing (before Space) does not reproduce it. The conversion must be started first.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.296 (VS Code extension, darwin-arm64)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Recording (macOS built-in Japanese IME):

  • 0:00–0:04 ↑ on the empty input recalls history as intended.
  • 0:05–0:07 Type あああ and press Space to start conversion.
  • 0:08–0:10 Each ↑ moves the IME candidate and also recalls a history entry (the input grows to two lines behind the candidate window).
  • 0:11 The input ends up as "aaaこんにちは / これはテスト用です": the composing text merged with a history entry.

https://github.com/user-attachments/assets/4d266ff9-1031-426a-87c8-53e8bbeeea6e

Screenshot: keydown log from a test page that applies the same check as the extension. Red lines are the events that would trigger the recall.

<img width="843" height="757" alt="Image" src="https://github.com/user-attachments/assets/f3c39785-a504-4b99-91bb-bbacf0098cfd" />

Environment: VS Code 1.141.0 (arm64), macOS 26.4.1. Reproduces with the macOS built-in Japanese IME and with a third-party IME.

Cause (from webview/index.js of 2.1.296): the message input's onKeyDown handler calls cycleMessage(-1) / cycleMessage(1) on ArrowUp / ArrowDown without checking for composition. The Enter branch of the same handler already returns on nativeEvent.isComposing.

cycleMessage(-1) only requires the selection to start at offset 0 of the first node. During conversion the selection covers the whole composing text (start=0), so composing at the start of the input always satisfies it.

Suggested fix: return early from the ArrowUp/ArrowDown branch when e.nativeEvent.isComposing || e.keyCode === 229, as other handlers in the webview already do.

Related: #66507 (Esc during IME composition, same missing isComposing guard).

View original on GitHub ↗