fix(tui): clipboard image paste on WSL via WSLg and alternative keybinds - #5
Closed
477174 wants to merge 3 commits into
Closed
fix(tui): clipboard image paste on WSL via WSLg and alternative keybinds#5477174 wants to merge 3 commits into
477174 wants to merge 3 commits into
Conversation
PowerShell processes spawned from WSL cannot access the Windows clipboard session (fundamental session isolation). The previous code tried PowerShell on WSL, which always failed silently. - Skip PowerShell clipboard read on WSL (dead code, ~500ms wasted) - Fix wl-paste/wl-copy on WSLg: override XDG_RUNTIME_DIR to /mnt/wslg/runtime-dir where the Wayland socket actually lives - Requires wl-clipboard package (apt install wl-clipboard) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Windows clipboard stores screenshots as BMP, which LLM APIs reject. When the clipboard only offers image/bmp (common on WSL via WSLg), convert to PNG using ffmpeg, ImageMagick magick, or convert before returning. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…age paste Windows Terminal intercepts Ctrl+V and doesn't pass it to terminal apps when the clipboard contains only an image. Add alternative mechanisms that bypass WT: - input_paste_image keybind (Ctrl+Alt+V) confirmed to pass through WT - /image slash command (aliases: /paste-image) - 'Paste image from clipboard' in command palette (Ctrl+P) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2 — Clipboard image paste doesn't work on WSL (Windows Terminal intercepts Ctrl+V).
Commits
fix(tui): fix clipboard image paste on WSL via WSLg Wayland bridge
wl-paste/wl-copyto useXDG_RUNTIME_DIR=/mnt/wslg/runtime-dir(WSLg socket location)fix(tui): convert BMP clipboard images to PNG for API compatibility
magick, orconvertfeat(tui): add Ctrl+Alt+V keybind and /image command for clipboard image paste
input_paste_imagekeybind (default:Ctrl+Alt+V)/imageslash command (alias:/paste-image)Ctrl+P)Ctrl+Vbehavior is unchangedWhy Ctrl+V can't work directly
Windows Terminal intercepts
Ctrl+Vat the emulator level. When clipboard has text, WT sends it as bracketed paste. When clipboard has only an image, WT sends nothing — zero bytes reach stdin. WT doesn't implement the Kitty keyboard protocol, so there's no way to receive the raw keypress.Ctrl+Alt+Vis confirmed to pass through WT.Testing
Ctrl+Alt+V— image should be pasted/image— same resultCtrl+P→ "Paste image from clipboard" — same resultCtrl+Vtext paste is unchanged