Skip to content

Commit

Permalink
Use taskkill for win32 (#936)
Browse files Browse the repository at this point in the history
* Use taskkill for win32

* Use spawn + taskkill in windows

* Revert to using tree-kill
  • Loading branch information
renkun-ken committed Jan 11, 2022
1 parent 9feabde commit b36afc8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,7 @@ export function asDisposable<T>(toDispose: T, disposeFunction: (...args: unknown

export type DisposableProcess = cp.ChildProcessWithoutNullStreams & vscode.Disposable;
export function exec(command: string, args?: ReadonlyArray<string>, options?: cp.CommonOptions, onDisposed?: () => unknown): DisposableProcess {
let proc: cp.ChildProcess;
if (process.platform === 'win32') {
const cmd = `"${command}" ${args.map(s => `"${s}"`).join(' ')}`;
proc = cp.exec(cmd, options);
} else {
proc = cp.spawn(command, args, options);
}
const proc = cp.spawn(command, args, options);
let running = true;
const exitHandler = () => {
running = false;
Expand Down

0 comments on commit b36afc8

Please sign in to comment.