Skip to content

Commit 4a65070

Browse files
committed
Enhance Vite command detection for frontend terminal routing
- Add specific Vite command detection patterns including vite.config and .bin/vite paths - Prioritize Vite commands to route to frontend terminal before general Node.js detection - Include Vite detection in logging for better debugging visibility - Ensure Vite dev server output appears in the correct frontend terminal
1 parent 3f7c6f3 commit 4a65070

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ipc/processors/response_processor.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,13 @@ export async function processFullResponseActions(
348348

349349
// Enhanced command detection with better patterns
350350
const isPythonCommand = /\b(python|pip|conda|venv|py |python3|pip3|django|flask|fastapi)\b/i.test(cleanCommand);
351-
const isNodeCommand = /\b(npm|yarn|pnpm|node|npx|vite|next|react|webpack|create-react-app|vue|angular|typescript|tsc)\b/i.test(cleanCommand);
351+
const isNodeCommand = /\b(npm|yarn|pnpm|node|npx|vite|next|react|webpack|create-react-app|vue|angular|typescript|tsc|pnpm|yarn)\b/i.test(cleanCommand);
352352
const isGoCommand = /\b(go|go run|go build|go mod|go get)\b/i.test(cleanCommand);
353353
const isRustCommand = /\b(cargo|cargo build|cargo run|cargo test)\b/i.test(cleanCommand);
354354

355+
// Additional check for Vite-specific commands and dev servers
356+
const isViteCommand = /\b(vite|vite\.config|\.bin\/vite)\b/i.test(cleanCommand);
357+
355358
// Backend commands (Python, Go, Rust, database, server commands)
356359
const isBackendCommand = isPythonCommand || isGoCommand || isRustCommand ||
357360
/\b(server|backend|api|database|db|postgres|mysql|sqlite|mongodb|redis)\b/i.test(cleanCommand);
@@ -362,7 +365,7 @@ export async function processFullResponseActions(
362365

363366
logger.info(`[CHAT_COMMAND_ROUTING] Chat ${chatId} - Command: "${cleanCommand}"`);
364367
logger.info(`[CHAT_COMMAND_ROUTING] Chat ${chatId} - Chat mode: ${chatMode}`);
365-
logger.info(`[CHAT_COMMAND_ROUTING] Chat ${chatId} - Python: ${isPythonCommand}, Node.js: ${isNodeCommand}, Go: ${isGoCommand}, Rust: ${isRustCommand}`);
368+
logger.info(`[CHAT_COMMAND_ROUTING] Chat ${chatId} - Python: ${isPythonCommand}, Node.js: ${isNodeCommand}, Go: ${isGoCommand}, Rust: ${isRustCommand}, Vite: ${isViteCommand}`);
366369
logger.info(`[CHAT_COMMAND_ROUTING] Chat ${chatId} - Backend: ${isBackendCommand}, Frontend: ${isFrontendCommand}`);
367370

368371
// Priority-based routing: explicit tech detection first, then general command patterns

0 commit comments

Comments
 (0)