fix(win): Gateway restart win terminal open error (#265)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Haze <hazeone@users.noreply.github.com>
This commit is contained in:
@@ -526,6 +526,7 @@ export async function validateChannelConfig(channelType: string): Promise<Valida
|
||||
cwd: openclawPath,
|
||||
encoding: 'utf-8',
|
||||
timeout: 30000,
|
||||
windowsHide: true,
|
||||
},
|
||||
(err, stdout) => {
|
||||
if (err) reject(err);
|
||||
|
||||
@@ -269,6 +269,7 @@ export function generateCompletionCache(): void {
|
||||
},
|
||||
stdio: 'ignore',
|
||||
detached: false,
|
||||
windowsHide: true,
|
||||
});
|
||||
|
||||
child.on('close', (code) => {
|
||||
@@ -305,7 +306,8 @@ export function installCompletionToProfile(): void {
|
||||
},
|
||||
stdio: 'ignore',
|
||||
detached: false,
|
||||
},
|
||||
windowsHide: true,
|
||||
}
|
||||
);
|
||||
|
||||
child.on('close', (code) => {
|
||||
|
||||
@@ -14,7 +14,7 @@ function getBundledUvPath(): string {
|
||||
const arch = process.arch;
|
||||
const target = `${platform}-${arch}`;
|
||||
const binName = platform === 'win32' ? 'uv.exe' : 'uv';
|
||||
|
||||
|
||||
if (app.isPackaged) {
|
||||
return join(process.resourcesPath, 'bin', binName);
|
||||
} else {
|
||||
@@ -53,7 +53,7 @@ function resolveUvBin(): { bin: string; source: 'bundled' | 'path' | 'bundled-fa
|
||||
function findUvInPathSync(): boolean {
|
||||
try {
|
||||
const cmd = process.platform === 'win32' ? 'where.exe uv' : 'which uv';
|
||||
execSync(cmd, { stdio: 'ignore', timeout: 5000 });
|
||||
execSync(cmd, { stdio: 'ignore', timeout: 5000, windowsHide: true });
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
@@ -95,6 +95,7 @@ export async function isPythonReady(): Promise<boolean> {
|
||||
try {
|
||||
const child = spawn(useShell ? quoteForCmd(uvBin) : uvBin, ['python', 'find', '3.12'], {
|
||||
shell: useShell,
|
||||
windowsHide: true,
|
||||
});
|
||||
child.on('close', (code) => resolve(code === 0));
|
||||
child.on('error', () => resolve(false));
|
||||
@@ -121,6 +122,7 @@ async function runPythonInstall(
|
||||
const child = spawn(useShell ? quoteForCmd(uvBin) : uvBin, ['python', 'install', '3.12'], {
|
||||
shell: useShell,
|
||||
env,
|
||||
windowsHide: true,
|
||||
});
|
||||
|
||||
child.stdout?.on('data', (data) => {
|
||||
@@ -210,12 +212,13 @@ export async function setupManagedPython(): Promise<void> {
|
||||
const child = spawn(verifyShell ? quoteForCmd(uvBin) : uvBin, ['python', 'find', '3.12'], {
|
||||
shell: verifyShell,
|
||||
env: { ...process.env, ...uvEnv },
|
||||
windowsHide: true,
|
||||
});
|
||||
let output = '';
|
||||
child.stdout?.on('data', (data) => { output += data; });
|
||||
child.on('close', () => resolve(output.trim()));
|
||||
});
|
||||
|
||||
|
||||
if (findPath) {
|
||||
logger.info(`Managed Python 3.12 installed at: ${findPath}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user