@@ -263,7 +263,7 @@ Index: code-server/lib/vscode/src/server-main.ts
263263===================================================================
264264--- code-server.orig/lib/vscode/src/server-main.ts
265265+++ code-server/lib/vscode/src/server-main.ts
266- @@ -22 ,6 +22 ,9 @@ import { IServerAPI } from './vs/server/
266+ @@ -23 ,6 +23 ,9 @@ import { IServerAPI } from './vs/server/
267267 perf.mark('code/server/start');
268268 (globalThis as { vscodeServerStartTime?: number }).vscodeServerStartTime = performance.now();
269269
@@ -273,15 +273,33 @@ Index: code-server/lib/vscode/src/server-main.ts
273273 // Do a quick parse to determine if a server or the cli needs to be started
274274 const parsedArgs = minimist(process.argv.slice(2), {
275275 boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'],
276- @@ -150,6 +153,7 @@ if (shouldSpawnCli) {
276+ @@ -50,7 +53,7 @@ if (shouldSpawnCli) {
277+ mod.spawnCli();
278+ });
279+ } else {
280+ - installServerProcessExitDiagnostics();
281+ + installServerProcessExitDiagnostics(parsedArgs);
282+
283+ let _remoteExtensionHostAgentServer: IServerAPI | null = null;
284+ let _remoteExtensionHostAgentServerPromise: Promise<IServerAPI> | null = null;
285+ @@ -153,6 +156,7 @@ if (shouldSpawnCli) {
277286 }
278287 });
279288 }
280289+ }
281290
282291 function sanitizeStringArg(val: unknown): string | undefined {
283292 if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
284- @@ -283,3 +287,22 @@ function prompt(question: string): Promi
293+ @@ -173,7 +177,7 @@ function sanitizeStringArg(val: unknown)
294+ * provided) so they survive process teardown (an async stdio write from an
295+ * `exit` handler does not).
296+ */
297+ - function installServerProcessExitDiagnostics(): void {
298+ + function installServerProcessExitDiagnostics(parsedArgs: minimist.ParsedArgs): void {
299+ if (!process.env['VSCODE_SERVER_EXIT_DIAGNOSTICS']) {
300+ return;
301+ }
302+ @@ -406,3 +410,22 @@ function prompt(question: string): Promi
285303 });
286304 });
287305 }
0 commit comments