claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

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

Open webmasterfsd opened this issue 3 months ago • 6 comments

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

webmasterfsd avatar Oct 21 '25 09:10 webmasterfsd

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?

shinypb avatar Oct 23 '25 02:10 shinypb

Hello @shinypb

Here some sample screenshots I have taken, but there are a lot of unwanted characters added sometimes based our inputs.

Image Image Image Image Image Image

**- 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 avatar Oct 24 '25 11:10 webmasterfsd

Any updates on this please!

webmasterfsd avatar Oct 24 '25 19:10 webmasterfsd

Still waiting for response!

webmasterfsd avatar Oct 26 '25 15:10 webmasterfsd

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.

shinypb avatar Oct 27 '25 17:10 shinypb

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.

github-actions[bot] avatar Dec 08 '25 10:12 github-actions[bot]