From adfc8152ddb5c1a4038e606d6350ed5353a46761 Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Tue, 26 Nov 2024 20:04:46 +0100 Subject: [PATCH] use spawn not terminal --- src/runner-server-vscode/index.ts | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/runner-server-vscode/index.ts b/src/runner-server-vscode/index.ts index 6eb6e5e8a8d..1b0f474dc1b 100644 --- a/src/runner-server-vscode/index.ts +++ b/src/runner-server-vscode/index.ts @@ -217,7 +217,19 @@ function activate(context : ExtensionContext) { if(address) { args.push('--server', address) } - context.subscriptions.push(window.createTerminal("runner.client", dotnetPath, args)) + + let startproc = spawn(dotnetPath, args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env } }); + startproc.stdout.on('data', async (data) => { + var sdata = data.asciiSlice(); + console.log(sdata) + }); + startproc.stderr.on('data', async (data) => { + var sdata = data.asciiSlice(); + console.log(sdata) + }); + startproc.addListener('exit', code => { + console.log(code); + }); }); commands.registerCommand("runner.server.runjob", async (workflow, job, events) => { console.log(`runner.server.runjob {workflow}.{job}`) @@ -226,7 +238,19 @@ function activate(context : ExtensionContext) { if(address) { args.push('--server', address) } - context.subscriptions.push(window.createTerminal("runner.client", dotnetPath, args)) + + let startproc = spawn(dotnetPath, args, { windowsHide: true, stdio: 'pipe', shell: false, env: { ...process.env } }); + startproc.stdout.on('data', async (data) => { + var sdata = data.asciiSlice(); + console.log(sdata) + }); + startproc.stderr.on('data', async (data) => { + var sdata = data.asciiSlice(); + console.log(sdata) + }); + startproc.addListener('exit', code => { + console.log(code); + }); }); context.subscriptions.push(client);