Skip to content

fix(tui): add Alt+V as fallback keybind for image paste on Windows Terminal#17539

Closed
pirrozani wants to merge 1 commit intoanomalyco:devfrom
pirrozani:pirrozani/fix-tui-windows-terminal-image-paste
Closed

fix(tui): add Alt+V as fallback keybind for image paste on Windows Terminal#17539
pirrozani wants to merge 1 commit intoanomalyco:devfrom
pirrozani:pirrozani/fix-tui-windows-terminal-image-paste

Conversation

@pirrozani
Copy link
Contributor

Issue for this PR

Closes #13800, #10154
Related issues: #13322, #12075
Related unmerged PRs from other contributors: #13161, #13871, #8626

Type of change

  • Bug fix

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+v as a second default for input_paste ("ctrl+v,alt+v"). Windows Terminal doesn't intercept Alt+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+V with no image in clipboard does nothing. On macOS/Linux where Ctrl+V already passes through, it's a harmless extra binding.

How did you verify your code works?

Tested on Windows 11 + Windows Terminal. Alt+V with an image in clipboard inserts [Image 1] in the prompt. Ctrl+V text paste unaffected.

Screenshots / recordings

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Contributor

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:

  1. fix: add alt+v keybind for pasting images #8495 - "fix: add alt+v keybind for pasting images"

    • Directly addresses the same Alt+V keybind solution for image pasting
  2. fix(tui): make Windows image paste reliable #13161 - "fix(tui): make Windows image paste reliable"

    • Mentioned in the current PR as a related unmerged PR; addresses Windows image paste reliability
  3. fix: handle text clipboard paste on Ctrl+V for Windows terminals #13871 - "fix: handle text clipboard paste on Ctrl+V for Windows terminals"

    • Mentioned in the current PR as a related unmerged PR; addresses Ctrl+V clipboard paste on Windows
  4. fix(tui): fix Ctrl+V paste on Windows/WSL2 (#6560 and #8209) #8626 - "fix(tui): fix Ctrl+V paste on Windows/WSL2"

    • Mentioned in the current PR as a related unmerged PR; addresses Ctrl+V paste issues on Windows/WSL2
  5. fix(tui): support clipboard image paste with proper filename on WSL2 #8209 - "fix(tui): support clipboard image paste with proper filename on WSL2"

    • Related to clipboard image paste functionality on Windows environments

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.

@pirrozani
Copy link
Contributor Author

PR #8495 does exactly the same (did not find that earlier), so i am closing this PR.

@pirrozani pirrozani closed this Mar 15, 2026
@pirrozani pirrozani deleted the pirrozani/fix-tui-windows-terminal-image-paste branch March 15, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ctrl+V paste not working on Windows 11 TUI

1 participant