diff --git a/database.sqlite-shm b/database.sqlite-shm index 14aecaa6..cf04ed76 100644 Binary files a/database.sqlite-shm and b/database.sqlite-shm differ diff --git a/database.sqlite-wal b/database.sqlite-wal index 5f613853..2d53d276 100644 Binary files a/database.sqlite-wal and b/database.sqlite-wal differ diff --git a/public/claude-ide/terminal.js b/public/claude-ide/terminal.js index 47404962..e69d5d2f 100644 --- a/public/claude-ide/terminal.js +++ b/public/claude-ide/terminal.js @@ -1140,6 +1140,8 @@ class TerminalManager { * Switch to specific terminal */ async switchToTerminal(terminalId) { + this.debugLog('INIT', `switchToTerminal called for ${terminalId}, checking if terminal in map...`); + // Hide all containers and remove active class document.querySelectorAll('.terminal-container').forEach(c => { c.classList.remove('active'); @@ -1159,13 +1161,27 @@ class TerminalManager { // Initialize xterm.js if not already done if (!this.terminals.has(terminalId)) { + this.debugLog('INIT', `Terminal ${terminalId} NOT in map, calling initializeXTerm...`); await this.initializeXTerm(terminalId); + } else { + this.debugLog('INIT', `Terminal ${terminalId} already in map, skipping initialization`); } // Fit terminal const terminal = this.terminals.get(terminalId); if (terminal && terminal.fitAddon) { - setTimeout(() => terminal.fitAddon.fit(), 100); + this.debugLog('INIT', `Calling fitAddon.fit() for ${terminalId} in 100ms...`); + setTimeout(() => { + this.debugLog('INIT', `Executing fitAddon.fit() for ${terminalId}`); + try { + terminal.fitAddon.fit(); + this.debugLog('INIT', `fitAddon.fit() completed for ${terminalId}`); + } catch (error) { + this.debugLog('ERROR', `fitAddon.fit() failed for ${terminalId}`, { error: error.message }); + } + }, 100); + } else { + this.debugLog('INIT', `No fitAddon for terminal ${terminalId} (terminal=${!!terminal}, fitAddon=${!!terminal?.fitAddon})`); } } @@ -1175,6 +1191,7 @@ class TerminalManager { tab.classList.add('active'); } + this.debugLog('INIT', `switchToTerminal completed for ${terminalId}`); this.activeTerminalId = terminalId; }