feat(comparator): rebuild as real terminal workspace with PTY shells#67
Merged
feat(comparator): rebuild as real terminal workspace with PTY shells#67
Conversation
Replace the old comparator (~6,400 lines, 43 files) with a real terminal workspace built on portable-pty + xterm.js. Each terminal is a live login shell with the user's zsh config, bidirectional I/O, and responsive grid. Architecture: - Rust: PTY lifecycle (create/destroy/write/resize), harness detection - React: TerminalPanel (xterm.js), TerminalGrid (CSS Grid), InvokeDialog - Hook: useTerminals with Tauri event wiring (terminal://output, exit) - Harness defs: TypeScript command builder with verified CLI invocations Supported harnesses (interactive mode, live streaming TUI): - Claude Code: claude 'prompt' --model MODEL - Cursor Agent: agent 'prompt' --model MODEL - GitHub Copilot: copilot -i 'prompt' --model MODEL - Codex CLI: codex 'prompt' --model MODEL Key fixes during development: - serde camelCase mismatch between Rust events and JS listeners - Missing get_cwd command for terminal working directory - Grid rows need explicit 1fr for proper terminal sizing - Shell quoting moved to TypeScript for testability Tests: 596 JS tests (39 files), 43 Rust tests including serde wire-format contract tests to prevent field name mismatches. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Cap rawChunks at 5000 entries to prevent unbounded memory growth (W1) - Use sessionsRef for createTerminal capacity guard and invokeAll to avoid stale closures over sessions state (W3, S2) - Clean up PTY sessions on hook unmount to prevent orphaned processes (W5) - Restrict Tauri shell capabilities for agent/copilot/codex to --version only instead of arbitrary args (W7) - Simplify rawChunks effect dependency to just length (W8) - Add ARIA labels to icon buttons and dialog, htmlFor/id on form fields (S5) - Add security note on write_terminal trust boundary (C1) - Fix Copilot invocation: use -i flag for interactive mode (verified from docs) - Use interactive mode (no -p) for all harnesses — full TUI with live streaming Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Architecture
create/destroy/write/resize),get_cwd, harness detection for claude/agent/copilot/codexTerminalPanel(xterm.js),TerminalGrid(responsive CSS Grid),InvokeDialog(harness/model/prompt picker),TerminalToolbaruseTerminalswith Tauri event wiring (terminal://output,terminal://exit)harness-definitions.ts) with verified CLI invocations andshellQuote()utilitySupported harnesses (interactive mode, live streaming)
claude 'prompt' --model Mclaude --versionagent 'prompt' --model Magent --versioncopilot -i 'prompt' --model Mcopilot --versioncodex 'prompt' --model Mcodex --versionTest plan
🤖 Generated with Claude Code