-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(windows): add support powershell qwen for image pasting #1232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(windows): add support powershell qwen for image pasting #1232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends clipboard image functionality to support Windows platforms using PowerShell, complementing the existing macOS implementation. The changes enable Windows users to paste images from the clipboard using Ctrl+V.
Key Changes:
- Added Windows-specific implementation using PowerShell's System.Windows.Forms and System.Drawing assemblies for clipboard image detection and saving
- Refactored both
clipboardHasImage()andsaveClipboardImage()functions to support platform-specific implementations - Maintained existing macOS functionality while adding fallback for unsupported platforms
Comments suppressed due to low confidence (1)
packages/cli/src/ui/utils/clipboardUtils.ts:70
- The description says the PR is for "qwen" but the testing instructions mention "@.gemini-clipboard/clipboard-{timestamp}.png". This inconsistency suggests either the documentation is incorrect or there's confusion about the project naming. The file path format should match the actual implementation.
// This avoids security restrictions on paths outside the target directory
const baseDir = targetDir || process.cwd();
const tempDir = path.join(baseDir, '.gemini-clipboard');
await fs.mkdir(tempDir, { recursive: true });
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
thanks for your contribution! I followed the testing instructions as described: Switched to this PR branch Additionally, I noticed an inconsistency: the PR description states this is for qwen, but the implementation creates a temp directory named .gemini-clipboard, and the testing instructions also reference @.gemini-clipboard/.... This suggests a possible naming mismatch—should this be aligned with qwen? If it’s a shared utility module, please clarify this in the documentation. Could you please verify whether the Windows implementation has been fully tested and working? In particular, check the clipboard monitoring and paste event handling logic on Windows. Looking forward to your investigation! |
TLDR
This PR adds Windows support for clipboard image functionality, allowing users on Windows to paste images from the clipboard using the existing shortcut (Ctrl+V). The implementation supports PowerShell environments.
Dive Deeper
This PR adds Windows support by:
[System.Windows.Forms.Clipboard]::ContainsImage()for image detectionSystem.Drawing.ImagingReviewer Test Plan
npm run build@.gemini-clipboard/clipboard-{timestamp}.pngis insertedTesting Matrix