debug: add detailed spawn attempt and error logging

- Log spawn attempt before calling spawn()
- Add detailed error logging with stack trace
- This will help identify if spawn is failing silently
This commit is contained in:
uroma
2026-01-19 19:26:40 +00:00
Unverified
parent 879e729b9f
commit d19f74a6a6
3 changed files with 5 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -58,6 +58,8 @@ class TerminalService {
const terminalId = `term-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; const terminalId = `term-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
try { try {
console.log(`[TerminalService] Attempting to spawn PTY with shell: ${shell}, cwd: ${workingDir}`);
// Spawn PTY process // Spawn PTY process
const pty = spawn(shell, [], { const pty = spawn(shell, [], {
name: 'xterm-color', name: 'xterm-color',
@@ -91,6 +93,9 @@ class TerminalService {
return { success: true, terminalId, terminal }; return { success: true, terminalId, terminal };
} catch (error) { } catch (error) {
console.error(`[TerminalService] Failed to create terminal:`, error); console.error(`[TerminalService] Failed to create terminal:`, error);
console.error(`[TerminalService] Error stack:`, error.stack);
console.error(`[TerminalService] Error name:`, error.name);
console.error(`[TerminalService] Error message:`, error.message);
return { success: false, error: error.message }; return { success: false, error: error.message };
} }
} }