feat: 增加对 Windows CLI 工具的支持,允许使用 cmd 作为首选 shell,并改进错误处理

This commit is contained in:
catlog22
2026-02-20 11:14:22 +08:00
parent 113d0bd234
commit d6bf941113
10 changed files with 174 additions and 28 deletions

View File

@@ -341,9 +341,16 @@ export const useTerminalGridStore = create<TerminalGridStore>()(
);
return { paneId: newPaneId, session };
} catch (error) {
console.error('Failed to create CLI session:', error);
return null;
} catch (error: unknown) {
// Handle both Error instances and ApiError objects
const errorMsg = error instanceof Error
? error.message
: (error as { message?: string })?.message
? (error as { message: string }).message
: String(error);
console.error('Failed to create CLI session:', errorMsg, { config, projectPath, rawError: error });
// Re-throw with meaningful message so UI can display it
throw new Error(errorMsg);
}
},