You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 23, 2025. It is now read-only.
Extract selectActiveTerminal method to eliminate duplicate logic
- Factor out shared terminal selection logic into private selectActiveTerminal method
- Both sendToActiveTerminal and sendTextToActiveTerminal now use the same selection logic
- Eliminates ~80 lines of duplicate terminal finding code
- Improves maintainability with single source of truth for terminal selection
- Fix type safety for shellPID handling
Co-authored-by: Claude <[email protected]>
vscode.window.showWarningMessage('No terminals found. Please open a terminal with an active AI assistant.');
72
-
return;
71
+
returnnull;
73
72
}
74
73
75
-
// Get active terminals with MCP servers from registry
76
74
constactiveTerminals=this.getActiveTerminals();
77
75
this.log(`Active MCP server terminals: [${Array.from(activeTerminals).join(', ')}]`);
78
76
79
77
if(activeTerminals.size===0){
80
78
vscode.window.showWarningMessage('No terminals with active MCP servers found. Please ensure you have a terminal with an active AI assistant (like Q chat or Claude CLI) running.');
81
-
return;
79
+
returnnull;
82
80
}
83
81
84
82
// Filter terminals to only those with active MCP servers
// Find active terminal using same logic as sendToActiveTerminal
151
-
constterminals=vscode.window.terminals;
152
-
if(terminals.length===0){
153
-
vscode.window.showWarningMessage('No terminals found. Please open a terminal with an active AI assistant.');
154
-
return;
155
-
}
156
-
157
-
constactiveTerminals=this.getActiveTerminals();
158
-
if(activeTerminals.size===0){
159
-
vscode.window.showWarningMessage('No terminals with active MCP servers found. Please ensure you have a terminal with an active AI assistant (like Q chat or Claude CLI) running.');
0 commit comments