From 86ee4da34bf04f52dea537f8a5051b98520c16dd Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 12 Nov 2024 00:10:36 +1100 Subject: [PATCH 1/5] fix-restart-client-win --- subsystems/sidecar/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsystems/sidecar/index.js b/subsystems/sidecar/index.js index 775f08d31..e773e530c 100644 --- a/subsystems/sidecar/index.js +++ b/subsystems/sidecar/index.js @@ -541,7 +541,7 @@ class Sidecar extends ReadyResource { else spawn(applingPath, opts).unref() } else { const cmd = command('run', ...runDefinition) - cmd.parse(cmdArgs.slice(1)) + cmd.parse(['--detached', ...cmdArgs.slice(1)]) const linkIndex = cmd?.indices?.args?.link const link = cmd?.args?.link From 6cc0df761bfec52326a1c8aaf12c03d9d53039e8 Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 12 Nov 2024 00:14:40 +1100 Subject: [PATCH 2/5] fix-restart-client-win --- subsystems/sidecar/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsystems/sidecar/index.js b/subsystems/sidecar/index.js index e773e530c..ae8d9148b 100644 --- a/subsystems/sidecar/index.js +++ b/subsystems/sidecar/index.js @@ -540,8 +540,10 @@ class Sidecar extends ReadyResource { if (isMac) spawn('open', [applingPath.split('.app')[0] + '.app'], opts).unref() else spawn(applingPath, opts).unref() } else { + cmdArgs.splice(1, 0, '--detached') + const cmd = command('run', ...runDefinition) - cmd.parse(['--detached', ...cmdArgs.slice(1)]) + cmd.parse(cmdArgs.slice(1)) const linkIndex = cmd?.indices?.args?.link const link = cmd?.args?.link From 04e7a54e1846a96665d52318c09c801f803175fe Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 12 Nov 2024 00:27:11 +1100 Subject: [PATCH 3/5] fix-restart-client-win --- subsystems/sidecar/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subsystems/sidecar/index.js b/subsystems/sidecar/index.js index ae8d9148b..512f02e7f 100644 --- a/subsystems/sidecar/index.js +++ b/subsystems/sidecar/index.js @@ -540,7 +540,9 @@ class Sidecar extends ReadyResource { if (isMac) spawn('open', [applingPath.split('.app')[0] + '.app'], opts).unref() else spawn(applingPath, opts).unref() } else { - cmdArgs.splice(1, 0, '--detached') + if (!cmdArgs.includes('--detached')) { + cmdArgs.splice(1, 0, '--detached') + } const cmd = command('run', ...runDefinition) cmd.parse(cmdArgs.slice(1)) From 16d02a93f4d825e5f3ed53fc36d91ca1a4cbc90c Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 12 Nov 2024 00:32:10 +1100 Subject: [PATCH 4/5] fix-restart-client-win --- subsystems/sidecar/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsystems/sidecar/index.js b/subsystems/sidecar/index.js index 512f02e7f..5655de6dc 100644 --- a/subsystems/sidecar/index.js +++ b/subsystems/sidecar/index.js @@ -540,7 +540,7 @@ class Sidecar extends ReadyResource { if (isMac) spawn('open', [applingPath.split('.app')[0] + '.app'], opts).unref() else spawn(applingPath, opts).unref() } else { - if (!cmdArgs.includes('--detached')) { + if (!cmdArgs.includes('--detach')) { cmdArgs.splice(1, 0, '--detached') } From 71d819ce4aa99dc852c97773eb2c984765789135 Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 12 Nov 2024 00:38:36 +1100 Subject: [PATCH 5/5] fix-restart-client-win --- subsystems/sidecar/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/subsystems/sidecar/index.js b/subsystems/sidecar/index.js index 5655de6dc..7b3172c8a 100644 --- a/subsystems/sidecar/index.js +++ b/subsystems/sidecar/index.js @@ -522,7 +522,7 @@ class Sidecar extends ReadyResource { if (platform === false) { const { dir, cwd, cmdArgs, env } = client.userData.state const appling = client.userData.state.appling - const opts = { cwd, env, detached: true, stdio: 'ignore' } + const opts = { cwd, env, detached: false, stdio: 'ignore' } if (!client.closed) { await new Promise((resolve) => { if (client.closed) { @@ -540,10 +540,6 @@ class Sidecar extends ReadyResource { if (isMac) spawn('open', [applingPath.split('.app')[0] + '.app'], opts).unref() else spawn(applingPath, opts).unref() } else { - if (!cmdArgs.includes('--detach')) { - cmdArgs.splice(1, 0, '--detached') - } - const cmd = command('run', ...runDefinition) cmd.parse(cmdArgs.slice(1))