[BUG] Terminal freeze on paste in Cursor integrated terminal — PTY layer bottleneck (not Claude Code process)
Preflight Checklist
- [x] I have searched existing issues
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Pasting text (>1KB) into Claude Code running in Cursor's integrated terminal causes a complete terminal freeze. The freeze is in Cursor's PTY/renderer layer, not in the Claude Code process itself — confirmed by stack sampling showing Claude Code idle at 99.5% during the hang.
This does NOT reproduce in VS Code, iTerm2, or Terminal.app with the same text.
Environment
| Component | Version |
|-----------|---------|
| Claude Code | 2.1.76 |
| macOS | 26.3.1 (25D2128), Apple Silicon |
| Cursor | 2.6.19 (Electron 39.4.0, Chromium 142.0.7444.265) |
| Cursor node-pty | 1.1.0-beta42 |
| Cursor @xterm/xterm | 5.6.0-beta.99 |
| Node.js (system) | v25.2.1 |
| Shell | zsh |
Steps to Reproduce
- Open Cursor 2.6.19
- Open the integrated terminal
- Run
claude(v2.1.76) - Copy >1KB of text to clipboard
- Paste with Cmd+V
- Terminal freezes — no input accepted, must kill the session
Expected Behavior
Text appears as [Pasted text #1 +N lines] (bracketed paste folding).
Actual Behavior
Terminal becomes completely unresponsive. The Claude Code process itself continues to run normally.
Diagnostic Evidence
Stack sampling (sample <pid> 3) during freeze:
2407/2419 samples (99.5%) → kevent64 (idle event loop)
7/2419 samples → StreamBase::Write path
5/2419 samples → timer/callback processing
The Claude Code Node.js process is NOT blocked. It's waiting for events normally. The blockage is between Cursor's PTY host and the terminal renderer.
tty state during freeze (stty -a):
-icanon -isig -iexten -echo (raw mode — expected for Ink TUI)
Workarounds tried (none resolved the freeze)
| Setting | Result |
|---------|--------|
| ignoreBracketedPasteMode: false | No effect |
| enablePersistentSessions: false | Removed Replaying 1018 chars from ptyhost.log, but freeze persists |
| scrollback: 500 | No effect |
| gpuAcceleration: "off" | No effect |
| smoothScrolling: false | No effect |
| ENABLE_IDE_INTEGRATION=false | No effect |
| terminalProgressBarEnabled: false | No effect |
| prefersReducedMotion: true | No effect |
| SessionEnd hook printf '\033[?2004l' | No effect on freeze (helps with post-exit paste corruption) |
Analysis
This is distinct from #3134 (bracketed paste mode restoration after exit). The freeze occurs during paste, not after exit. The root cause appears to be Cursor's bundled node-pty 1.1.0-beta42 failing to handle backpressure when large paste input is sent to a raw-mode PTY.
Cursor's GitHub repository has issues disabled, making this the only viable place to report the Cursor-specific behavior.
Related Issues
- #3134 — Bracketed paste mode corruption (related but different symptom)
- #32443 — CLI freezes on text paste input (same symptom, Cursor-specific)
- #34258 — Terminal freezes on paste in Cursor integrated terminal
- #11611 — 162MB stdout deadlock on paste (extreme case of same backpressure issue)
Claude Model
Claude Sonnet 4
Is this a regression?
No — has persisted across multiple Claude Code versions in Cursor
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Cursor integrated terminal (zsh)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗