File tree 1 file changed +7
-2
lines changed
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> => {
52
52
53
53
try {
54
54
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 )
55
61
} catch ( error : any ) {
62
+ // spawnCli catches all errors, but just in case that changes.
56
63
logger . error ( "Got error from Code" , error )
57
64
process . exit ( 1 )
58
65
}
59
-
60
- process . exit ( 0 )
61
66
}
62
67
63
68
export const openInExistingInstance = async ( args : DefaultedArgs , socketPath : string ) : Promise < void > => {
You can’t perform that action at this time.
0 commit comments