Skip to content

Commit

Permalink
use spawn not terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX authored Nov 26, 2024
1 parent c040f09 commit adfc815
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/runner-server-vscode/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand All @@ -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);
Expand Down

0 comments on commit adfc815

Please sign in to comment.