Fix: Windows Multi-line Paste Handling with Debounced Data Processing#627
Merged
Conversation
Contributor
📋 Review SummaryThis PR addresses a critical issue with multi-line paste operations on Windows terminals, where Node.js readline was losing bracketed paste boundaries, causing accidental command submissions. The solution implements platform-specific handling for Windows with debounced buffer processing to correctly distinguish between user keypresses and paste fragments. The changes are well-structured and include comprehensive test coverage. 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
Fix: Windows Multi-line Paste Handling with Debounced Data Processing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Problem Description
Issue: On Windows terminals, multi-line paste operations were causing accidental command submissions due to Node.js readline losing bracketed paste boundaries.
Root Cause Analysis
ESC[200~(start) andESC[201~(end) to mark paste boundariesExample Scenario
Instead of being treated as a single paste operation, each newline becomes a separate Return keypress, causing the command to submit prematurely.
🔧 Solution Implementation
Core Changes
process.platform === 'win32')Key Technical Improvements
1. Windows Detection & Passthrough Mode
2. Debounced Raw Data Processing
3. Improved Buffer Management
🧪 Testing Strategy
New Test Coverage
🔍 Validation
Before Fix
After Fix
🚀 Deployment Notes
Linked issues / bugs