Implement proper ready-state handshake to fix command execution timing. Root Cause: WebSocket connection was opening immediately, but the backend PTY (pseudo-terminal) wasn't ready to receive input yet. Commands sent too early were lost, causing claude --dangerously-skip-permissions to never execute. Broken Flow: 1. WebSocket opens → connectTerminal() resolves immediately 2. Command sent → PTY not ready, command lost 3. Terminal shows cursor but Claude CLI never starts Fixed Flow: 1. WebSocket opens → Wait for 'ready' message from backend 2. Backend sends 'ready' → PTY is now initialized 3. Command sent → PTY receives it successfully 4. Claude CLI starts Changes: - Add 'ready' flag to terminal state (default false) - connectTerminal() now waits for 'ready' message before resolving - Add waitForTerminalReady() helper with 5s timeout - launchCommand() checks ready state before sending - Enhanced error handling and console logging Resolves: "terminal does not show or execute claude cli" Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
42 KiB
42 KiB