-
Notifications
You must be signed in to change notification settings - Fork 14k
Bug: image paste fails in WSL2 when clipboard exposes image/bmp and XDG_SESSION_TYPE is unset #22274
Copy link
Copy link
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalityeffort/medium2-3 days: UI state, async flow, cross-component refactors2-3 days: UI state, async flow, cross-component refactorshelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!We will accept PRs from all issues marked as "help wanted". Thanks for your support!kind/bugpriority/p2Important but can be addressed in a future release.Important but can be addressed in a future release.status/bot-triagedtype/bug
Metadata
Metadata
Assignees
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalityeffort/medium2-3 days: UI state, async flow, cross-component refactors2-3 days: UI state, async flow, cross-component refactorshelp wantedWe will accept PRs from all issues marked as "help wanted". Thanks for your support!We will accept PRs from all issues marked as "help wanted". Thanks for your support!kind/bugpriority/p2Important but can be addressed in a future release.Important but can be addressed in a future release.status/bot-triagedtype/bug
Type
Fields
Give feedbackNo fields configured for Bug.
Projects
StatusShow more project fields
No status
What happened?
I am running Gemini CLI inside WSL2 Ubuntu on a Windows 11 host, launched from Windows Terminal.
When I copy an image on Windows and press
Alt+Vinsidegeminirunning in WSL2, image paste fails.After debugging, I found that in this WSL2 environment:
XDG_SESSION_TYPEis unsetWAYLAND_DISPLAY=wayland-0DISPLAY=:0When an image is copied on Windows, the Linux clipboard side exposes
image/bmprather thanimage/png.This suggests Gemini CLI's Linux clipboard image handling is not fully compatible with this WSL2 case.
What did you expect to happen?
I expected
Alt+Vimage paste to work in WSL2 when the clipboard contains an image.Gemini CLI should ideally:
XDG_SESSION_TYPEis unsetWAYLAND_DISPLAY/DISPLAYin WSL2-like environmentswl-paste/xclipimage/bmpgracefully, for example by converting it internally to PNG before attachingClient information
Client information
CLI Version: 0.33.1
Platform: Linux
OS: Ubuntu 24.04.3 LTS
Kernel: Linux momo 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 GNU/Linux
Sandbox Environment: no sandbox
Model Version: auto-gemini-3 (configured)
Selected Auth Type: oauth-personal
GCP Project: [not set]
IDE Client: [none]
User Email: ***@gmail.com
Additional environment:
Clipboard behavior observed during reproduction:
image/bmpLogin information
Google Account login (
oauth-personal)Anything else we need to know?
Steps to reproduce
Copy an image into the Windows clipboard
Open Windows Terminal
Enter WSL2 Ubuntu
Run:
Start Gemini CLI:
gemini
Press Alt+V
Notes
A local compatibility patch that:
made the same workflow work correctly in the same environment.
The same Windows clipboard image became attachable in the same WSL2 environment after that local compatibility patch. This makes the issue look like a Gemini CLI Linux/WSL
clipboard compatibility gap rather than a Windows clipboard bridge problem.