[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_
10 Comments
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.
<img width="1918" height="524" alt="Image" src="https://github.com/user-attachments/assets/367f1046-fa37-44f8-902a-4de3e9ab218f" />
<img width="1902" height="648" alt="Image" src="https://github.com/user-attachments/assets/8ee467d1-95e3-444a-8f2a-f62517074239" />
<img width="992" height="315" alt="Image" src="https://github.com/user-attachments/assets/28f6fcf9-5139-455f-8d1d-1a24bb67b8a4" />
<img width="1912" height="436" alt="Image" src="https://github.com/user-attachments/assets/b7baebbf-ba28-4513-b17c-b71a12be8cae" />
<img width="452" height="257" alt="Image" src="https://github.com/user-attachments/assets/4aa7180f-31db-42d4-8e53-0b8e0f2ca81f" />
<img width="1903" height="352" alt="Image" src="https://github.com/user-attachments/assets/d1d038ea-5989-474f-b71b-e9d2aac0f652" />
**- Based on the inputs, when we proceed, it often adds many unwanted HTML characters that aren’t present in the original text.
Any updates on this please!
Still waiting for response!
Hi there! I see the screenshots where
# - BACKGROUND POOLturned into\# - BACKGROUND POOLand whereWAIT_BETWEEN_PROMPTSbecameWAIT\_BETWEEN\_PROMPTS; very helpful.# - BACKGROUND POOL, do you always end up with\# - BACKGROUND POOLwhen you return to Claude Code?$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.
I have the same issue, it happens with notepad (adding lines, backslashes and even to the text) and does not happen with Visual Studio Code.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.