Multiline paste in CLI duplicates current prompt and ignores intermediate lines
What happened?
When using Gemini CLI, if I paste a multiline prompt into the terminal prompt without using \ escape characters, the CLI behaves incorrectly. Specifically:
The current prompt line gets duplicated multiple times.
All intermediate lines from the pasted content are ignored.
Only the last line from the pasted content is submitted.
This causes Gemini to receive an incomplete and error-prone prompt, leading to incorrect or redundant responses.
What did you expect to happen?
I expected the Gemini CLI to correctly process all lines from the pasted multiline input, preserving formatting and line breaks, instead of ignoring intermediate lines or multiplying the current prompt.
Client information
Client Information
> /about
About Gemini CLI
CLI Version 0.3.4
Git Commit 2acadeca
Model gemini-2.5-flash
Sandbox no sandbox
OS win32
Auth Method OAuth
Login information
I faced the same issue using Google Account login as well as API key login.
Anything else we need to know?
This issue especially affects workflows where I prepare longer structured prompts (such as markdown or code snippets) and paste them directly into Gemini CLI. It reduces usability and makes the CLI unreliable for multiline contexts.
The issue describes a bug where pasting multiline input into the CLI prompt fails to process the text correctly, which is a user experience problem. It affects the core usability of the CLI for users who work with structured text or code snippets. Based on the detailed report, the issue has sufficient information for investigation.
#7863
When I paste this:
When using Gemini CLI, if I paste a multiline prompt into the terminal prompt without using \ escape characters, the CLI behaves incorrectly. Specifically:
The current prompt line gets duplicated multiple times.
All intermediate lines from the pasted content are ignored.
Only the last line from the pasted content is submitted.
This causes Gemini to receive an incomplete and error-prone prompt, leading to incorrect or redundant responses.
What did you expect to happen?
I expected the Gemini CLI to correctly process all lines from the pasted multiline input, preserving formatting and line breaks, instead of ignoring intermediate lines or multiplying the current prompt.
I will get this:
Hey @doggy8088 , what I meant is a prompt such as logs or something and when we already have some prompt in the prompt window, try to check it out as the problem is still not resolved, not the text over here as it has default escape character embedded.
Something like this mentioned in issue #7863
I think I mentioned a new issue. :)
I also recieve this issue, which makes working with Gemini CLI impossible
I'm having the same issue on a mac, gemini cli 0.5.3. With claude code I'm used to copy&paste logs from the browser console or other places and it just handles it well - like attaching a file. similar issues: https://github.com/google-gemini/gemini-cli/issues/8288 https://github.com/google-gemini/gemini-cli/issues/4938 https://github.com/google-gemini/gemini-cli/issues/3476
When I paste this:
When using Gemini CLI, if I paste a multiline prompt into the terminal prompt without using \ escape characters, the CLI behaves incorrectly. Specifically:
The current prompt line gets duplicated multiple times.
All intermediate lines from the pasted content are ignored.
Only the last line from the pasted content is submitted.
This causes Gemini to receive an incomplete and error-prone prompt, leading to incorrect or redundant responses.
What did you expect to happen? I expected the Gemini CLI to correctly process all lines from the pasted multiline input, preserving formatting and line breaks, instead of ignoring intermediate lines or multiplying the current prompt. I will get this:
![]()
My issue already been resolved.
one solution is push CTRL+X twice so that you edit the cli text buffer in notepad, and there you can put as many lines as you want