fix(desktop): suppress terminal query responses using xterm.js parser…#196
fix(desktop): suppress terminal query responses using xterm.js parser…#196
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… hooks Replace hacky PTY-level escape sequence filtering with proper xterm.js parser hooks. Terminal query responses (DA1, DA2, CPR, OSC color responses) are now suppressed at the display layer using the official xterm.js API. Changes: - Remove terminal-escape-filter.ts module and its tests - Add suppressQueryResponses.ts with xterm.js parser hooks - Update terminal-manager.ts to pass raw data through - Integrate parser hooks in terminal creation The parser hooks intercept CSI sequences ending in 'c' (device attributes), 'R' (cursor position reports), '$y' (mode reports), and OSC 10-19 (color query responses) - returning true to suppress display. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
7127060 to
fc1d0d7
Compare
|
Caution Review failedThe pull request is closed. WalkthroughThis change replaces a regex-based terminal escape sequence filter module with xterm.js parser-hook-based suppression. The TerminalEscapeFilter class and its integration are removed, and a new suppressQueryResponses function uses xterm parser handlers to intercept protocol-level terminal responses (device attributes, cursor reports, mode reports, color queries) at the parser level. Changes
Sequence Diagram(s)sequenceDiagram
participant Term as Terminal Component
participant Helper as createTerminalInstance
participant XTerm as xterm Instance
participant Parser as xterm Parser
participant Handlers as Query Response Handlers
Term->>Helper: createTerminalInstance(container, cwd, theme)
Helper->>XTerm: new Terminal()
Helper->>XTerm: create FitAddon
Helper->>XTerm: registerHandler(CSI 'c') - DA
Helper->>XTerm: registerHandler(CSI 'R') - CPR
Helper->>XTerm: registerHandler(CSI $ 'y') - Mode Report
Helper->>XTerm: registerHandler(OSC 10-19) - Colors
Helper->>Handlers: return cleanup function
Helper-->>Term: {xterm, fitAddon, cleanup}
Note over Parser: Terminal receives DA/CPR/OSC<br/>sequences from pty
Parser->>Handlers: executeCSI 'c'
Handlers->>Handlers: suppress (return TRUE)
Parser->>Handlers: executeCSI 'R'
Handlers->>Handlers: suppress (return TRUE)
Term->>Term: Component unmounts
Term->>Term: cleanup()
Handlers->>Handlers: dispose all registered handlers
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
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 |
… hooks
Replace hacky PTY-level escape sequence filtering with proper xterm.js parser hooks. Terminal query responses (DA1, DA2, CPR, OSC color responses) are now suppressed at the display layer using the official xterm.js API.
Changes:
The parser hooks intercept CSI sequences ending in 'c' (device attributes), 'R' (cursor position reports), '$y' (mode reports), and OSC 10-19 (color query responses) - returning true to suppress display.
🤖 Generated with Claude Code
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.