Markdown editor submits plan feedback comment when Enter confirms Japanese IME composition
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.7k
- PR merge metrics
- PR metrics pending
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.139.0-insider (Universal) 289549a85cd652ce3513ac63044495a2ac620752
- OS Version: Darwin arm64 25.6.0
Steps to Reproduce:
- Start a Copilot coding agent session in Plan mode.
- Wait for a plan that supports feedback to be generated.
- Open the full plan in the Markdown editor.
- Select part of the plan and open the inline comment input.
- Type Japanese text and start an IME conversion.
- Press Enter to confirm the active conversion.
https://github.com/user-attachments/assets/c57fc388-62a1-4485-a9e3-dc8620cec1ec
Expected:
Enter confirms the Japanese IME conversion without submitting the feedback comment.
After the composition has finished, pressing Enter should continue to submit the comment normally.
Actual:
The IME conversion is confirmed, but the same Enter key event also submits the inline feedback comment immediately.
This can submit an incomplete comment while the user is still composing Japanese text.
This specifically occurs in the Markdown editor's inline comment input while reviewing a plan and Markdown feedback is enabled.
It is not the regular Copilot Chat input, and changing the workbench.action.chat.submit keybinding does not affect it.
Local verification
I temporarily patched the bundled Markdown editor included in VS Code Insiders:
extensions/markdown-language-features/markdown-editor-out/editor.js
The bundled handler was equivalent to:
let r = o => {
if (o.stopPropagation(), o.key === "Escape") {
o.preventDefault();
this._options?.onCancel?.();
return;
}
o.key === "Enter" && !o.shiftKey &&
(o.preventDefault(), this._submit());
};
I changed it locally to ignore keyboard events owned by an active IME
composition:
let r = o => {
if (o.stopPropagation(), o.isComposing || o.keyCode === 229) {
return;
}
if (o.key === "Escape") {
o.preventDefault();
this._options?.onCancel?.();
return;
}
o.key === "Enter" && !o.shiftKey &&
(o.preventDefault(), this._submit());
};
After completely restarting VS Code Insiders, Enter confirmed the Japanese IME conversion without submitting the comment.
Pressing Enter after the composition had finished still submitted the comment normally.
For this local verification I used both event.isComposing and the legacy keyCode === 229 fallback.
I have not isolated which condition is necessary in this environment.
The production fix may only need event.isComposing, consistent with other keyboard handlers.
The readable source for this handler appears to be @vscode/markdown-editor's CommentInputWidget, rather than extensions/markdown-language-features/markdown-editor-src/editor.ts.
The latter instantiates CommentModeController, while the dependency implementation is bundled into markdown-editor-out/editor.js.
A possible source-level fix would be:
const onKeyDown = (event: KeyboardEvent): void => {
event.stopPropagation();
if (event.isComposing) {
return;
}
if (event.key === 'Escape') {
event.preventDefault();
this._options?.onCancel?.();
return;
}
if (event.key === 'Enter' && !event.shiftKey) {
event.preventDefault();
this._submit();
}
};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the @vscode/markdown-editor CommentInputWidget source that produces the handler bundled in extensions/markdown-language-features/markdown-editor-out/editor.js; extensions/markdown-language-features/markdown-editor-src/editor.ts instantiates the related controller. Reproduce the Japanese IME flow in a plan's Markdown inline comment input and verify that Enter confirms composition without submitting, while Enter after composition still submits normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100