File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -52,12 +52,17 @@ export const runCodeCli = async (args: DefaultedArgs): Promise<void> => {
5252
5353 try {
5454 await spawnCli ( await toCodeArgs ( args ) )
55+ // Rather than have the caller handle errors and exit, spawnCli will exit
56+ // itself. Additionally, it does this on a timeout set to 0. So, try
57+ // waiting for VS Code to exit before giving up and doing it ourselves.
58+ await new Promise ( ( r ) => setTimeout ( r , 1000 ) )
59+ logger . warn ( "Code never exited" )
60+ process . exit ( 0 )
5561 } catch ( error : any ) {
62+ // spawnCli catches all errors, but just in case that changes.
5663 logger . error ( "Got error from Code" , error )
5764 process . exit ( 1 )
5865 }
59-
60- process . exit ( 0 )
6166}
6267
6368export const openInExistingInstance = async ( args : DefaultedArgs , socketPath : string ) : Promise < void > => {
You can’t perform that action at this time.
0 commit comments