mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix(process-utils): fix bug that prevented start-up when running process walking command fails (#7757)
This commit is contained in:
@@ -24,6 +24,7 @@ async function getProcessInfo(pid: number): Promise<{
|
|||||||
name: string;
|
name: string;
|
||||||
command: string;
|
command: string;
|
||||||
}> {
|
}> {
|
||||||
|
try {
|
||||||
const platform = os.platform();
|
const platform = os.platform();
|
||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
const powershellCommand = [
|
const powershellCommand = [
|
||||||
@@ -58,6 +59,10 @@ async function getProcessInfo(pid: number): Promise<{
|
|||||||
command: fullCommand,
|
command: fullCommand,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
} catch (_e) {
|
||||||
|
console.debug(`Failed to get process info for pid ${pid}:`, _e);
|
||||||
|
return { parentPid: 0, name: '', command: '' };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -169,7 +174,6 @@ async function getIdeProcessInfoForWindows(): Promise<{
|
|||||||
* top-level ancestor process ID and command as a fallback.
|
* top-level ancestor process ID and command as a fallback.
|
||||||
*
|
*
|
||||||
* @returns A promise that resolves to the PID and command of the IDE process.
|
* @returns A promise that resolves to the PID and command of the IDE process.
|
||||||
* @throws Will throw an error if the underlying shell commands fail.
|
|
||||||
*/
|
*/
|
||||||
export async function getIdeProcessInfo(): Promise<{
|
export async function getIdeProcessInfo(): Promise<{
|
||||||
pid: number;
|
pid: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user