[BUG] Ctrl+G prompt editor inserts extra blank lines and the literal string “Markup Types Before Each Line”

Status Closed — not planned
Maintainer reply None cached
Activity 10 comments · opened Oct 21, 2025 · closed Feb 5, 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?

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_

View original on GitHub ↗

10 Comments

shinypb · 11 months ago

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?

webmasterfsd · 11 months ago

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.

  • 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.**
webmasterfsd · 11 months ago

Any updates on this please!

webmasterfsd · 11 months ago

Still waiting for response!

shinypb · 11 months ago

Hi there! I see the screenshots where # - BACKGROUND POOL turned into \# - BACKGROUND POOL and where WAIT_BETWEEN_PROMPTS became WAIT\_BETWEEN\_PROMPTS; very helpful.

  1. 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 POOL when you return to Claude Code?
  2. Are there any other substitutions you notice consistently?
  3. 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" ; claude to use that instead of Notepad.

Thank you kindly.

github-actions[bot] · 10 months ago

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.

aivarsi · 9 months ago

I have the same issue, it happens with notepad (adding lines, backslashes and even &nbsp; to the text) and does not happen with Visual Studio Code.

github-actions[bot] · 8 months ago

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.

marcindulak · 8 months ago

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.

github-actions[bot] · 8 months ago

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.