Commit Graph

4 Commits

  • debug: add visual debug panel and comprehensive logging
    - Added debug panel in terminal view that shows all terminal activity
    - Added debugLog() method to TerminalManager for consistent logging
    - Updated connectTerminal, handleTerminalMessage, launchCommand, createTerminal, initializeXTerm with detailed logging
    - Enhanced backend logging for WebSocket messages and close codes
    - Logs now show both to console and visual debug panel
    
    This should help diagnose the terminal command execution issue without
    requiring browser console access.
  • debug: add comprehensive logging for terminal command flow
    Phase 1 of systematic debugging: Gather evidence
    
    Added detailed logging to trace the complete command flow:
    - launchCommand: Shows when called, terminalId, command, WebSocket state
    - waitForTerminalReady: Shows waiting period and ready state
    - handleTerminalMessage: Shows all messages from backend with details
    - WebSocket message content logged before sending
    
    Also fixed duplicate 'ready' message (removed line 113-116).
    
    Now when user creates "Claude Code CLI" terminal, console will show:
    1. launchCommand called with terminalId and command
    2. Waiting for terminal ready
    3. Ready message received (or timeout)
    4. Command sent to WebSocket
    5. All backend messages logged
    
    This will reveal exactly where the flow breaks.
    
    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  • fix: backend sends ready message when WebSocket connects
    Critical fix: The frontend was waiting for a 'ready' message that the
    backend never sent, causing commands to timeout.
    
    Root Cause:
    Frontend connectTerminal() waits for 'ready' message from backend
    before resolving, but backend never sent this message. Result: Frontend
    timed out after 5 seconds waiting for ready state, and commands were
    never sent.
    
    Fix:
    Send 'ready' message immediately when WebSocket connection is established.
    This signals to frontend that PTY is initialized and ready to receive input.
    
    Flow Now:
    1. Frontend creates terminal UI
    2. Frontend initializes xterm.js
    3. Frontend connects WebSocket
    4. Backend receives connection, sends 'ready' message
    5. Frontend receives 'ready', sets ready=true, resolves promise
    6. Frontend sends claude --dangerously-skip-permissions command
    7. Command executes successfully
    
    Resolves: "still getting empty terminal"
    
    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
  • Initial commit: Obsidian Web Interface for Claude Code
    - Full IDE with terminal integration using xterm.js
    - Session management with local and web sessions
    - HTML preview functionality
    - Multi-terminal support with session picker
    
    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>