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

When pasting text that ends with '{' character in Windows Command Prompt, the text gets truncated at the '{' and immediately executed.

Open chingchun94 opened this issue 1 year ago • 3 comments

What happened?

Steps to Reproduce

  1. Open Windows Command Prompt
  2. Run gemini
  3. Paste this text: Hi Gemini, access this updateCheck.ts From original if (notifier.update){
  4. Observe truncation and auto-execution

Actual Behavior

Text gets cut off at '{' and executes immediately.

Environment

  • Platform: Windows Command Prompt (legacy console)
  • Works fine in: WSL
  • Gemini CLI Version: [run /about command]

Root Cause ( Suspect )

Windows Command Prompt appends DEL character (0x7f) after '{' which triggers backspace operation in text-buffer.ts:577-583.

Workaround

Use WSL instead of legacy CommandPrompt.

Image

What did you expect to happen?

Full text should be pasted without truncation or auto-execution

Client information

$ gemini /about
# paste output here
 About Gemini CLI                            
  ┌─────────────────────────────────────────────┐
  │ About Gemini CLI                            │
  │                                             │
  │ CLI Version    0.1.7                        │
  │ Git Commit     55cc809                      │
  │ Model          gemini-2.5-pro               │
  │ Sandbox        no sandbox                   │
  │ OS             win32                        │
  │ Auth Method    OAuth                        │
  └─────────────────────────────────────────────┘

Login information

Google Account

Anything else we need to know?

No response

chingchun94 avatar Jun 28 '25 12:06 chingchun94

Fyi @bbiggs looks like another keyboard input related issue. Seems like pastes on windows arent coming through as pastes. Any ideas on mitigations? We may need to revert the input handling changes.

jacob314 avatar Jun 28 '25 14:06 jacob314

What node version?

bbiggs avatar Jun 28 '25 16:06 bbiggs

v22.16.0

chingchun94 avatar Jun 28 '25 16:06 chingchun94