code-yeongyu / code-yeongyu/senpi
Windows Terminal Ctrl+V image paste is ignored as empty bracketed paste
- Dominant language
- TypeScript
- Stars
- 429
- Forks
- 98
- Avg merge
- 5h 3m
- Merged PRs (30d)
- 526
Description
## What happened?
On Windows Terminal under WSL, Ctrl+V is owned by the terminal's paste action, so Senpi does not receive the raw `app.clipboard.pasteImage` key. Windows Terminal 1.24 represents an image-only paste as an empty bracketed-paste sequence (`ESC[200~ ESC[201~`).
Senpi's base `Editor` consumes that empty sequence without content, while `CustomEditor` only calls `onPasteImage` for the raw keybinding. The existing WSL PowerShell fallback in `readClipboardImage()` can read the screenshot correctly; it is simply never triggered.
A core reproduction without extensions is to give `CustomEditor.handleInput()` `\x1b[200~\x1b[201~`: `onPasteImage` is called zero times.
This matters because Ctrl+V image paste works in other terminal agents without requiring users to replace their normal terminal paste shortcut.
## Steps to reproduce
1. Run Senpi under WSL in Windows Terminal 1.24 with Ctrl+V bound to terminal paste.
2. Copy a screenshot to the Windows clipboard.
3. Press Ctrl+V in Senpi.
Observed: no image is attached.
## Expected behavior
An image-only empty bracketed paste should call Senpi's existing image paste handler. Normal non-empty text paste must remain unchanged.
A local one-branch patch in `CustomEditor.handleInput()` was verified through a live Senpi TUI: the event attached a readable PNG, while text paste, Ctrl+J, and Enter regression checks remained green.
## Version
Senpi 2026.7.31-2; Windows Terminal 1.24.11911.0; WSL2.
Contributor guide
Research direction
Start in CustomEditor.handleInput() and reproduce the issue with the empty bracketed-paste sequence \x1b[200~\x1b[201~; readClipboardImage() to understand the existing WSL fallback. Done means an image-only empty paste calls onPasteImage while non-empty text paste, Ctrl+J, and Enter remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100