[BUG] Cmd+V pastes literal 'v' instead of clipboard content in VS Code integrated terminal
Bug Report
Summary
Pressing Cmd+V inside the Claude Code CLI prompt when running in VS Code or VS Code Insiders integrated terminal inserts a literal v character instead of pasting clipboard content. This is exclusively a Claude Code issue — all other CLI tools (bash prompt, npm scripts, other interactive CLIs) paste correctly in the same terminal. It also works perfectly in macOS native Terminal.app.
---
Steps to Reproduce
- Open VS Code or VS Code Insiders on macOS
- Open the integrated terminal (
Ctrl+\) - Run
claudeto start Claude Code CLI - Copy any text to your clipboard (
Cmd+C) - At the Claude Code input prompt, press
Cmd+Vto paste
Result: A literal v character is typed instead of the clipboard content.
---
Expected Behavior
The clipboard content should be pasted into the Claude Code input area, exactly as it does in macOS Terminal.app or iTerm2.
---
Actual Behavior
Only the character v is inserted at the cursor position. The clipboard content is ignored entirely.
---
Environment
| Property | Value |
|---|---|
| OS | macOS |
| macOS Version | Darwin 25.4.0 |
| Shell | zsh |
| Editor | VS Code / VS Code Insiders |
| Terminal | VS Code Integrated Terminal |
| Issue in native Terminal.app | ❌ Not reproducible (works fine) |
| Issue with other CLIs in VS Code terminal | ❌ Not reproducible (works fine) |
| Issue with Claude Code in VS Code terminal | ✅ Reproducible |
---
Root Cause Analysis
When Cmd+V is pressed in VS Code's integrated terminal, VS Code intercepts it via the workbench.action.terminal.paste action and sends the clipboard content wrapped in a bracketed paste escape sequence:
\x1b[200~ <clipboard content> \x1b[201~
This is a standard terminal feature (Bracketed Paste Mode) that allows terminal applications to distinguish pasted text from typed text.
Claude Code's raw mode input handler does not appear to correctly handle this bracketed paste sequence in VS Code's terminal environment. Instead of recognising and unwrapping the sequence, it appears to fall back to interpreting keystrokes individually — where Cmd is dropped (as it has no direct TTY representation) and only v is passed through.
This is confirmed by the fact that:
- Other interactive CLI tools in the same VS Code terminal paste correctly (they handle bracketed paste or receive the plain text without issue)
- The problem disappears when using Claude Code in macOS Terminal.app or iTerm2
---
What Has Been Tried
- Verified VS Code keybinding
workbench.action.terminal.pasteis correctly bound toCmd+V— it is. - Verified no extension conflicts by running
code --disable-extensions— issue persists. - Verified
terminal.integrated.sendKeybindingsToShellisfalse— issue persists. - Other interactive CLIs (e.g., Python REPL, Node REPL, bash prompt) paste correctly in the same terminal session.
---
Workarounds (Temporary)
| Workaround | Notes |
|---|---|
| Right-click → Paste | Works reliably |
| Ctrl+Shift+V | VS Code's alternative paste shortcut |
| pbpaste \| claude | Pipe clipboard content on launch |
---
Suggested Fix Direction
Claude Code's input handler should either:
- Enable bracketed paste mode (
\x1b[?2004h) and properly strip the\x1b[200~/\x1b[201~wrappers when pasting, or - Detect the VS Code terminal environment (
TERM_PROGRAM=vscode) and adjust paste handling accordingly.
Most modern readline-based terminal UIs (e.g., fish shell, zsh with bracketed paste support) handle this automatically.
---
References
- Bracketed Paste Mode spec
- VS Code integrated terminal paste:
workbench.action.terminal.paste - Related env var:
TERM_PROGRAM=vscode
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗