fix(tui): add Alt+V as fallback keybind for image paste on Windows Terminal#17539
fix(tui): add Alt+V as fallback keybind for image paste on Windows Terminal#17539pirrozani wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found several related PRs that may be duplicates or closely related to PR #17539: Potential Duplicates/Related PRs:
These PRs all relate to the same underlying issue: clipboard image paste on Windows Terminal/environments. PR #8495 appears to be the most directly related as it also implements the Alt+V keybind solution. |
|
PR #8495 does exactly the same (did not find that earlier), so i am closing this PR. |
Issue for this PR
Closes #13800, #10154
Related issues: #13322, #12075
Related unmerged PRs from other contributors: #13161, #13871, #8626
Type of change
What does this PR do?
On Windows Terminal, Ctrl+V is intercepted by the terminal before the TUI's onKeyDown fires. When the clipboard has only an image, Windows Terminal sends nothing — so the existing clipboard image read path never triggers.
Adds
alt+vas a second default for input_paste ("ctrl+v,alt+v"). Windows Terminal doesn't interceptAlt+V, so it reaches onKeyDown and the existing PowerShell clipboard read works as intended.Safe cross-platform: @opentui/core blocks character insertion when key.meta is true, so
Alt+Vwith no image in clipboard does nothing. On macOS/Linux whereCtrl+Valready passes through, it's a harmless extra binding.How did you verify your code works?
Tested on Windows 11 + Windows Terminal.
Alt+Vwith an image in clipboard inserts [Image 1] in the prompt.Ctrl+Vtext paste unaffected.Screenshots / recordings
Checklist