File tree 2 files changed +11
-5
lines changed 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -250,13 +250,19 @@ const main = async(): Promise<boolean | void | void[]> => {
250
250
return startCli ( ) || new WrapperProcess ( ) . start ( ) ;
251
251
} ;
252
252
253
+ const exit = process . exit ;
254
+ process . exit = function ( code ?: number ) {
255
+ const err = new Error ( `process.exit() was prevented: ${ code || "unknown code" } .` ) ;
256
+ console . warn ( err . stack ) ;
257
+ } as ( code ?: number ) => never ;
258
+
253
259
// It's possible that the pipe has closed (for example if you run code-server
254
260
// --version | head -1). Assume that means we're done.
255
261
if ( ! process . stdout . isTTY ) {
256
- process . stdout . on ( "error" , ( ) => process . exit ( ) ) ;
262
+ process . stdout . on ( "error" , ( ) => exit ( ) ) ;
257
263
}
258
264
259
265
main ( ) . catch ( ( error ) => {
260
266
logger . error ( error . message ) ;
261
- process . exit ( typeof error . code === "number" ? error . code : 1 ) ;
267
+ exit ( typeof error . code === "number" ? error . code : 1 ) ;
262
268
} ) ;
Original file line number Diff line number Diff line change @@ -653,9 +653,9 @@ export class MainServer extends Server {
653
653
this . _onDidClientConnect . fire ( {
654
654
protocol, onDidClientDisconnect : connection . onClose ,
655
655
} ) ;
656
- // NOTE: We can do this because we only have one connection at a
657
- // time but if that changes we need a way to determine which clients
658
- // belong to a connection and dispose only those .
656
+ // TODO: Need a way to match clients with a connection. For now
657
+ // dispose everything which only works because no extensions currently
658
+ // utilize long-running proxies .
659
659
( this . services . get ( INodeProxyService ) as NodeProxyService ) . _onUp . fire ( ) ;
660
660
connection . onClose ( ( ) => ( this . services . get ( INodeProxyService ) as NodeProxyService ) . _onDown . fire ( ) ) ;
661
661
} else {
You can’t perform that action at this time.
0 commit comments