Skip to content

Windows: Toast popup when user presses ctrl+v - #181

Open
simo787c wants to merge 2 commits into
mainfrom
fix-add-toast-on-ctrl-v-windows-ce1
Open

simo787c wants to merge 2 commits into
mainfrom
fix-add-toast-on-ctrl-v-windows-ce1

Conversation

@simo787c

@simo787c simo787c commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Introduce a dismissable toast when pressing ctrl+v on windows pointing users to natively supported and working alt+v

Windows users pasting into the Claude Code TUI via Dash hit silent data loss: Ctrl+V and Ctrl+Shift+V drop text from long pastes silently. The root cause is in our own PTY layer: on Windows/ConPTY, node-pty ignores the Socket.write() backpressure return, so writes past ~2 KB are silently discarded. Fixing that properly means chunking writes in ptyManager — real work, and we'd instead point users to already existing keybind that properly supports long text truncations and images. Claude Code handles Alt+V natively for both text and images, so the paste never traverses our broken write path.

Alt+V is a Claude Code keybinding, not a Windows OS feature — so it isn't tied to any Windows version; it works anywhere Claude Code runs (including WSL).

  • It is the default for the chat:imagePaste action on Windows and WSL; macOS/Linux default that action to Ctrl+V instead. On WSL both are bound. (keybindings docs)
  • Claude Code's customizable keybindings — where Alt+V is documented — require v2.1.18+.
  • The Windows Alt+V image-paste fix specifically shipped in v2.1.157 (May 29, 2026), alongside the Windows 11 screenshot-paste fix and drag-from-Explorer support.
  • It exists because Windows Terminal reserves Ctrl+V for text paste and intercepts it before Claude Code sees it, so Alt+V is the native alternative.

Changes

File What
windowsPasteToast.tsx The toast: maybeShowWindowsPasteToast() + the PasteTip card
TerminalSessionManager.ts Fires the toast on Windows Ctrl+V; caches the isWindows platform check
settingsKeys.ts Registers hasDismissedWindowsPasteToast so the opt-out persists

Behaviour notes

  • Trigger is a pure side effect in the key handler — no preventDefault/return, so existing paste handling is untouched and Alt+V passes through unaffected.
  • Windows-only, gated on getPlatform() === 'win32'. Cached at construction rather than read per keystroke.
  • De-duped onto a fixed toast id, so holding Ctrl+V doesn't stack toasts.
  • Dismissal is two-tier: closing the toast stays quiet for the rest of the session but nudges once more next launch; ticking "Don't show again" persists via the new setting. The reasoning is that a user who dismisses without ticking probably hasn't internalised the tip yet.
  • Design mirrors the existing ports-wizard toast (PortsWizardToasts.tsx): same toast.custom card shell, icon + title + muted body, quiet opt-out on the left and the plain close on the right.

Testing

pnpm type-check passes; lint and the pre-commit hooks are green.

Verified in the running app (Windows 11): pressing Ctrl+V in a task terminal surfaces the toast. An earlier "the toast doesn't appear" report turned out to be environmental, not a code issue — a dev server from another checkout still held port 3000, so this worktree's Electron was loading the other renderer. (vite.config.ts sets server.port: 3000 without strictPort, so Vite silently falls back to 3001 while window.ts still loads localhost:3000 — a trap worth knowing if you run two Dash checkouts at once.)

Still worth a click-through before merge: the two dismissal paths — session-scoped (close/swipe, should re-nudge next launch) vs persisted (tick "Don't show again", reload, should stay gone).

Ctrl+V / Ctrl+Shift+V into the Claude Code TUI on Windows is unreliable:
ConPTY write drops truncate long text and clipboard images don't come
through at all. Alt+V is Claude Code's native paste shortcut and handles
both correctly, so show a tip toast pointing users at it.

The toast fires as a pure side effect from the terminal key handler, so
existing paste handling is untouched and Alt+V still passes through.
Closing it stays quiet for the rest of the session; ticking "Don't show
again" persists via the new hasDismissedWindowsPasteToast setting.

Co-Authored-By: Claude <noreply@anthropic.com> via Dash <dash@syv.ai>
Claude-Session: https://claude.ai/code/session_015oLvpKrtCrejbJQpzMSSHw
@simo787c simo787c changed the title Nudge Windows users toward Alt+V when pasting into the terminal Windows: Toast popup when user presses ctrl+v Jul 15, 2026
@simo787c
simo787c requested a review from nthomsencph July 17, 2026 10:57
@simo787c
simo787c requested review from nthomsencph and removed request for nthomsencph August 5, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant