File tree Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 2727 "dependencies" : {
2828 "node-ipc" : " 8.10.3" ,
2929 "source-map" : " 0.6.1" ,
30- "tree-kill" : " ^1.2.0" ,
3130 "universal-analytics" : " 0.4.13" ,
3231 "vscode-chrome-debug-core" : " ~3.9.0" ,
3332 "vscode-debugadapter" : " 1.26.0" ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import * as fs from 'fs';
1010import * as url from 'url' ;
1111import * as path from 'path' ;
1212import { Version } from './version' ;
13+ import { ChildProcess , exec } from 'child_process' ;
1314
1415export const enum Platform {
1516 Windows , OSX , Linux
@@ -380,4 +381,16 @@ export function getInstalledExtensionVersion(): Version {
380381
381382export function getMinSupportedCliVersion ( ) : Version {
382383 return Version . parse ( require ( '../../package.json' ) . minNativescriptCliVersion ) ;
384+ }
385+
386+ export function killProcess ( childProcess : ChildProcess ) : void {
387+ switch ( process . platform ) {
388+ case "win32" :
389+ exec ( `taskkill /pid ${ childProcess . pid } /T /F` ) ;
390+ break ;
391+
392+ default :
393+ childProcess . kill ( "SIGINT" ) ;
394+ break ;
395+ }
383396}
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {formatConsoleMessage} from './consoleHelper';
1616import { Services } from '../services/debugAdapterServices' ;
1717import { LoggerHandler , Handlers , Tags } from '../common/logger' ;
1818import { DebugRequest } from './debugRequest' ;
19- import * as kill from 'tree-kill' ;
2019
2120interface IScopeVarHandle {
2221 objectId : string ;
@@ -361,7 +360,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
361360 public disconnect ( ) : Promise < void > {
362361 this . clearEverything ( ) ;
363362 if ( this . _tnsProcess ) {
364- kill ( this . _tnsProcess . pid , 'SIGQUIT' )
363+ utils . killProcess ( this . _tnsProcess ) ;
365364 this . _tnsProcess = null ;
366365 }
367366 if ( this . _webKitConnection ) {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import {Services} from './services/extensionHostServices';
44import { Project } from './project/project' ;
55import { IosProject } from './project/iosProject' ;
66import { AndroidProject } from './project/androidProject' ;
7+ import * as utils from './common/utilities' ;
78
89// this method is called when the extension is activated
910export function activate ( context : vscode . ExtensionContext ) {
@@ -56,6 +57,10 @@ export function activate(context: vscode.ExtensionContext) {
5657 tnsProcess . on ( 'close' , exitCode => {
5758 runChannel . hide ( ) ;
5859 } ) ;
60+
61+ context . subscriptions . push ( {
62+ dispose : ( ) => utils . killProcess ( tnsProcess )
63+ } ) ;
5964 } ;
6065
6166 let runIosCommand = vscode . commands . registerCommand ( 'nativescript.runIos' , ( ) => {
You can’t perform that action at this time.
0 commit comments