File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 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[]> => {
250250 return startCli ( ) || new WrapperProcess ( ) . start ( ) ;
251251} ;
252252
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+
253259// It's possible that the pipe has closed (for example if you run code-server
254260// --version | head -1). Assume that means we're done.
255261if ( ! process . stdout . isTTY ) {
256- process . stdout . on ( "error" , ( ) => process . exit ( ) ) ;
262+ process . stdout . on ( "error" , ( ) => exit ( ) ) ;
257263}
258264
259265main ( ) . catch ( ( error ) => {
260266 logger . error ( error . message ) ;
261- process . exit ( typeof error . code === "number" ? error . code : 1 ) ;
267+ exit ( typeof error . code === "number" ? error . code : 1 ) ;
262268} ) ;
Original file line number Diff line number Diff line change @@ -653,9 +653,9 @@ export class MainServer extends Server {
653653 this . _onDidClientConnect . fire ( {
654654 protocol, onDidClientDisconnect : connection . onClose ,
655655 } ) ;
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 .
659659 ( this . services . get ( INodeProxyService ) as NodeProxyService ) . _onUp . fire ( ) ;
660660 connection . onClose ( ( ) => ( this . services . get ( INodeProxyService ) as NodeProxyService ) . _onDown . fire ( ) ) ;
661661 } else {
You can’t perform that action at this time.
0 commit comments