[BUG] Pasting multi-line text triggers premature submission (newline read as Enter) — Windows Terminal/PowerShell
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When pasting multi-line text into the prompt, newline characters in the pasted content are read as if Enter had been pressed. Instead of the paste landing as one multi-line block waiting for me to hit Enter, it submits partway through — either sending an incomplete prompt or splitting the paste across several separate messages.
This looks like the same root cause reported before on other terminals: the terminal isn't wrapping the paste in bracketed-paste escape sequences (\e[200~ ... \e[201~), so Claude Code can't tell a pasted newline apart from a typed one and treats it as a submit. Related prior reports (both auto-closed as stale, not fixed):
- #40909 (iTerm2, macOS)
- #47658 (mintty/Git Bash, Windows) — a commenter there also reproduced on PowerShell 5.1
What Should Happen?
Pasting multi-line text should insert it as a literal block with newlines preserved, and wait for an explicit Enter press to submit — regardless of whether it arrives as one bracketed-paste event or as a stream of individual keystrokes.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code in Windows Terminal running PowerShell 7.
- Copy any text containing multiple lines (e.g. a multi-line log excerpt or code snippet) to the clipboard.
- Paste it into the Claude Code prompt.
- Observe: the prompt submits before the full paste is in, or the message arrives split across multiple sends, instead of sitting in the input box as one block.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.198 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
- using Windows Terminal as the terminal emulator (PowerShell 7 as the shell).
editorMode: "vim"is set in~/.claude/settings.json. Not sure if vim mode changes the input-handling path here, but flagging it since two of the prior related reports (#73098) show vim mode affecting paste handling differently.