fix: await switchToTerminal to prevent race condition
The issue was that switchToTerminal() was not being awaited, so launchCommand() was called while switchToTerminal() was still executing. This caused a race condition where the WebSocket closed before the command could be sent. By awaiting switchToTerminal(), we ensure the terminal is fully switched before attempting to send any commands.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -276,7 +276,7 @@ class TerminalManager {
|
||||
|
||||
// Switch to new terminal
|
||||
this.debugLog('INIT', `Switching to terminal ${terminalId}...`);
|
||||
this.switchToTerminal(terminalId);
|
||||
await this.switchToTerminal(terminalId);
|
||||
this.debugLog('INIT', `Switched to terminal ${terminalId}`);
|
||||
|
||||
// Handle terminal type specific initialization
|
||||
|
||||
Reference in New Issue
Block a user