gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

sometimes during cut and paste, it seems that there are multiple inferences running. maybe defend that boundary a bit more.

Open kordless opened this issue 1 year ago • 8 comments

What happened?

If I paste in multi line JSON after already typing something in the input box, it would seem multiple threads run for inferencing. This is evident by the same/same replies seen that seem dependent on the number of line feeds in said paste.

What did you expect to happen?

I would expect it to only use a single inference pass on my input in the single input box.

Client information

  • CLI Version: 0.1.13
  • Git Commit: 412b78c5 (local modifications)
  • Operating System: win32 v22.16.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-2.5-pro
  • Memory Usage: 194.3 MB

Login information

No response

Anything else we need to know?

No response

kordless avatar Jul 26 '25 15:07 kordless

My thought that this is a quick win fix for the UI and could probably be done in 10-15 minutes, so I hope it gets fixed instead of buried. (NEVERMIND I'M FIXING IT)

kordless avatar Jul 26 '25 16:07 kordless

Ok, I have a fix operational, but floundering around with fixing the tests. It did take about 30 minutes to track down the issue.

kordless avatar Jul 26 '25 17:07 kordless

I just tried to reproduce using powershell and gemini cli 0.1.14 and I am unable to. Multiline pastes with line breaks work just as robustly as on other platforms. Would be curious what you do to reproduce. My suspicion is the core issue is likely that some actions are causing power shell to exit paste mode and that is the case we need to track down to resolve the issue.

jacob314 avatar Jul 28 '25 21:07 jacob314

Hey Jacob. Thanks for the quick response. I tried to fix the issue by altering the methods to cut and paste, but ran into problems with the test framework.

0.1.14 Is what I'm running.

The way to replicate is to type in something first, then to paste in a multi-line copy job. Powershell is 7.5.2.

Now that I'm thinking about it, I'm using terminal, which I wonder if that could be an issue....

Here's a screenshot. What I did was type "this is a test" then I selected the text above, from "Hey Jacob..." to "could be an issue" and pasted it in immediately after > this is a test. You see what results, with the last line "not being submitted" but all the other ones submitted, but with "this is a test" only, multiple times. I could send a video if needed.

And, in testing with Powershell instead of terminal, it totally works and the bug is not present. So, I would suggest that the ticket is closed (I'm happy to do that once I figure out how to use terminal with it without breaking) and would put up a resolution along with a note about why it was breaking.

Thanks for this and hope you have a good one!

[image: image.png]

On Mon, Jul 28, 2025 at 4:39 PM Jacob Richman @.***> wrote:

jacob314 left a comment (google-gemini/gemini-cli#4938) https://github.com/google-gemini/gemini-cli/issues/4938#issuecomment-3129956595

I just tried to reproduce using powershell and gemini cli 0.1.14 and I am unable to. Multiline pastes with line breaks work just as robustly as on other platforms. Would be curious what you do to reproduce. My suspicion is the core issue is likely that some actions are causing power shell to exit paste mode and that is the case we need to track down to resolve the issue.

— Reply to this email directly, view it on GitHub https://github.com/google-gemini/gemini-cli/issues/4938#issuecomment-3129956595, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAWA7PJNXK47KDXW7EUOXD3K2J7VAVCNFSM6AAAAACCNW77BGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMRZHE2TMNJZGU . You are receiving this because you authored the thread.Message ID: @.***>

kordless avatar Jul 29 '25 03:07 kordless

I encountered the same error on Windows 10 22H2. Pasting multiple lines doesn't seem to work in certain terminals. I tested this on PowerShell, Git Bash in the system terminal, and VS Code. It appears this issue is present in specific versions of Windows.

Image Image

TommrraraSnow avatar Aug 11 '25 03:08 TommrraraSnow

As a suggestion, I hope that the Gemini CLI can handle line breaks correctly in the input box instead of sending messages immediately when a line break is entered.

TommrraraSnow avatar Aug 11 '25 06:08 TommrraraSnow

Yes, the best practice for this is to hit space before pasting multi-line, and not writing much of anything before pasting, ever. Always put your comments AFTER the paste job. The space before text will prevent shell from activating.

On Mon, Aug 11, 2025 at 1:49 AM TommrraraSnow @.***> wrote:

TommrraraSnow left a comment (google-gemini/gemini-cli#4938) https://github.com/google-gemini/gemini-cli/issues/4938#issuecomment-3173459776

As a suggestion, I hope that the Gemini CLI can handle line breaks correctly in the input box instead of sending messages immediately when a line break is entered. At the same time, a way to enter line breaks such as Ctrl+Enter could also be added.

— Reply to this email directly, view it on GitHub https://github.com/google-gemini/gemini-cli/issues/4938#issuecomment-3173459776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAWA7LEFYJRSZR5KACHF4D3NA4IZAVCNFSM6AAAAACCNW77BGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNZTGQ2TSNZXGY . You are receiving this because you authored the thread.Message ID: @.***>

kordless avatar Aug 12 '25 14:08 kordless

Thanks for the tips. The problem was letting me ran out to Claude Code really close.

TommrraraSnow avatar Aug 13 '25 01:08 TommrraraSnow