@@ -24,6 +24,7 @@ import { getSessionId } from '../shared/telemetry/util'
24
24
import { NotificationsController } from '../notifications/controller'
25
25
import { DevNotificationsState } from '../notifications/types'
26
26
import { QuickPickItem } from 'vscode'
27
+ import { ChildProcess } from '../shared/utilities/processUtils'
27
28
28
29
interface MenuOption {
29
30
readonly label : string
@@ -44,6 +45,7 @@ export type DevFunction =
44
45
| 'editAuthConnections'
45
46
| 'notificationsSend'
46
47
| 'forceIdeCrash'
48
+ | 'startChildProcess'
47
49
48
50
export type DevOptions = {
49
51
context : vscode . ExtensionContext
@@ -126,6 +128,11 @@ const menuOptions: () => Record<DevFunction, MenuOption> = () => {
126
128
detail : `Will SIGKILL ExtHost, { pid: ${ process . pid } , sessionId: '${ getSessionId ( ) . slice ( 0 , 8 ) } -...' }, but the IDE itself will not crash.` ,
127
129
executor : forceQuitIde ,
128
130
} ,
131
+ startChildProcess : {
132
+ label : 'ChildProcess: Start child process' ,
133
+ detail : 'start a ChildProcess manually that is invoked through our wrapper' ,
134
+ executor : startChildProcess ,
135
+ } ,
129
136
}
130
137
}
131
138
@@ -578,3 +585,15 @@ async function editNotifications() {
578
585
await targetNotificationsController . pollForEmergencies ( )
579
586
} )
580
587
}
588
+
589
+ async function startChildProcess ( ) {
590
+ const result = await createInputBox ( {
591
+ title : 'Enter a command' ,
592
+ } ) . prompt ( )
593
+ if ( result ) {
594
+ const [ command , ...args ] = result ?. toString ( ) . split ( ' ' ) ?? [ ]
595
+ getLogger ( ) . info ( `Starting child process: '${ command } '` )
596
+ const processResult = await ChildProcess . run ( command , args , { collect : true } )
597
+ getLogger ( ) . info ( `Child process exited with code ${ processResult . exitCode } ` )
598
+ }
599
+ }
0 commit comments