[BUG] Ctrl+G prompt editor inserts extra blank lines and the literal string “Markup Types Before Each Line”
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?
When using the Claude Code CLI prompt editor via the Ctrl+G keybinding, saving the prompt causes the CLI to paste the prompt back into the input with (a) extra empty lines and (b) an unexpected string, Markup Types Before Each Line, sometimes prepended and sometimes interleaved between lines. This corrupts the prompt and requires manual cleanup before it can be executed.
Environment
OS: Windows 11
What Should Happen?
Expected Behavior
The exact prompt text is inserted once, with original line breaks preserved and no additional text added.
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
Open the Cloud/Claude Code CLI.
Press Ctrl+G to open the prompt editor (new or edit flow).
Type or paste a multi-line prompt (10–30 lines is enough).
Save/confirm to insert the prompt back into the CLI input.
Observe the pasted content in the input area.
Actual Behavior
The inserted content contains:
Multiple extra blank lines (one or more between existing lines).
The literal string Markup Types Before Each Line appearing at the start and/or interleaved throughout the prompt.
The resulting input is corrupted and requires manual cleanup (removing blank lines and the stray string) before running.
Reproducibility
Frequency: 100% (reproduces every time using Ctrl+G flow)
Scope: Occurs with both newly created and edited prompts
Prompt size: Happens with short and long prompts alike
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
Version 2.0.24
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
No response
Howdy @webmasterfsd! I'd like to look into this for you; which external editor are you using? Is there any chance you can grab a screencast for me?
Hello @shinypb
Here some sample screenshots I have taken, but there are a lot of unwanted characters added sometimes based our inputs.
**- Based on the inputs, when we proceed, it often adds many unwanted HTML characters that aren’t present in the original text.
- However, when we use the shortcut to go back to the editor—meaning, for example, a text editor—the inputs we provided there are correct.
- When we close it again and go back, then in the terminal inputs those unwanted characters appear again and are still there.**
Any updates on this please!
Still waiting for response!
Hi there! I see the screenshots where # - BACKGROUND POOL turned into \# - BACKGROUND POOL and where WAIT_BETWEEN_PROMPTS became WAIT\_BETWEEN\_PROMPTS; very helpful.
- Does that happen 100% of the time consistently? e.g. if you ctrl-g and enter
# - BACKGROUND POOL, do you always end up with\# - BACKGROUND POOLwhen you return to Claude Code? - Are there any other substitutions you notice consistently?
- I'm trying to determine if this problem is specific to Notepad. Would you mind trying with a different external editor? For example, if you have the Visual Studio Code's “code” tool installed, you could run
$env:EDITOR = "code" ; claudeto use that instead of Notepad.
Thank you kindly.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.