Conversation
When reattaching to a terminal, escape sequence responses (CPR, device attributes, OSC color queries) were being displayed as garbage text. This filters them from scrollback storage while preserving them for live xterm.js processing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Extract filterTerminalQueryResponses to terminal-escape-filter.ts - Add comprehensive test suite with 54 test cases covering: - Cursor Position Reports (CPR) including row-only format - Primary/Secondary Device Attributes (DA1/DA2) - Device Attributes without ? or > prefix - DEC Private Mode Reports (DECRPM) - OSC color responses (10-19) - Tertiary Device Attributes (DA3) - XTVERSION responses - Edge cases and mixed content - Simplify terminal-manager.test.ts to focus on integration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughThis PR adds terminal escape sequence filtering for PTY output. A new filter module uses regex patterns to remove terminal query responses from terminal data. The filter is applied before appending data to scrollback and history, while preserving unfiltered data for the xterm frontend. Changes
Sequence DiagramsequenceDiagram
participant PTY as PTY Process
participant Manager as Terminal Manager
participant Filter as Escape Filter
participant Scrollback as Scrollback/History
participant XTerm as XTerm Frontend
PTY->>Manager: data (with escape sequences)
Manager->>Filter: filterTerminalQueryResponses(data)
Filter->>Filter: apply regex patterns
Filter-->>Manager: filtered data
Manager->>Scrollback: store filtered data
Manager->>XTerm: emit unfiltered data
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (7)**/*.{ts,tsx,js,jsx,json}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/**/*.{tsx,ts}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/**/*.test.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/desktop/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
Files:
apps/desktop/**/*.{ts,tsx}📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
Files:
apps/desktop/**/*.test.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
Files:
🧠 Learnings (4)📚 Learning: 2025-11-24T21:33:13.244ZApplied to files:
📚 Learning: 2025-11-24T21:33:13.244ZApplied to files:
📚 Learning: 2025-11-24T21:33:13.244ZApplied to files:
📚 Learning: 2025-11-24T21:32:46.559ZApplied to files:
🧬 Code graph analysis (2)apps/desktop/src/main/lib/terminal-manager.ts (1)
apps/desktop/src/main/lib/terminal-escape-filter.test.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Summary by CodeRabbit
Release Notes
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.