Make connectTerminal() return a Promise that resolves when the
WebSocket connection is established, ensuring commands are sent
only after the terminal is ready.
Root cause:
- connectTerminal() created WebSocket but returned immediately
- 500ms delay wasn't reliable - WebSocket might not be open yet
- Command was sent before connection was ready, causing it to fail silently
Fix:
- Wrap WebSocket creation in Promise
- Resolve Promise in ws.onopen callback
- Reject on ws.onerror
- Remove unnecessary 500ms delay
Now when "Claude Code CLI" terminal type is selected:
1. WebSocket connection is established
2. We wait for connection to be ready
3. Command is sent immediately
4. claude --dangerously-skip-permissions launches reliably
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When launching Claude Code CLI with --dangerously-skip-permissions,
don't set the terminal mode to 'session' since we're not attaching
to an existing session. Keep it in 'mixed' mode instead.
The "Invalid session" error occurred because:
1. We launched claude --dangerously-skip-permissions without a session
2. Then set mode to 'session' which expects a valid session attachment
3. The CLI or backend rejected this as invalid
Fix: Remove the setMode call when using claude-cli terminal type.
Let the CLI create and manage its own session internally.
Resolves: "Invalid session" error when selecting Claude Code CLI
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add CSS styling for the terminal type dropdown that was already
implemented in the JavaScript but wasn't visible due to missing styles.
The dropdown allows users to choose between:
- Standard Shell (bash/zsh) - default
- Claude Code CLI - runs claude --dangerously-skip-permissions
When Claude Code CLI is selected:
- Session picker is skipped (not needed)
- Terminal automatically launches with claude --dangerously-skip-permissions
- Mode is automatically set to 'session'
Changes:
- Add .terminal-type-selection, .terminal-type-select styles to terminal.css
- Match existing modal styling (background, borders, focus states)
- JavaScript was already implemented from previous work
Resolves: "Claude Code CLI still not appears under terminal > new terminal"
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 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>