@@ -15,32 +15,31 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.
1515===================================================================
1616--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
1717+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
18- @@ -2,7 +2,9 @@
18+ @@ -2,7 +2,7 @@
1919 * Copyright (c) Microsoft Corporation. All rights reserved.
2020 * Licensed under the MIT License. See License.txt in the project root for license information.
2121 *--------------------------------------------------------------------------------------------*/
2222-
23- + import * as os from 'os';
2423+ import * as _http from 'http';
25- + import * as path from 'vs/base/common/path';
2624 import * as performance from 'vs/base/common/performance';
2725 import { createApiFactoryAndRegisterActors } from 'vs/workbench/api/common/extHost.api.impl';
2826 import { RequireInterceptor } from 'vs/workbench/api/common/extHostRequireInterceptor';
29- @@ -17,6 +19 ,7 @@ import { ExtensionRuntime } from 'vs/wor
27+ @@ -17,6 +17 ,7 @@ import { ExtensionRuntime } from 'vs/wor
3028 import { CLIServer } from 'vs/workbench/api/node/extHostCLIServer';
3129 import { realpathSync } from 'vs/base/node/extpath';
3230 import { ExtHostConsoleForwarder } from 'vs/workbench/api/node/extHostConsoleForwarder';
3331+ import { IExtHostWorkspace } from '../common/extHostWorkspace';
3432 import { ExtHostDiskFileSystemProvider } from 'vs/workbench/api/node/extHostDiskFileSystemProvider';
3533
3634 class NodeModuleRequireInterceptor extends RequireInterceptor {
37- @@ -83,6 +86 ,52 @@ export class ExtHostExtensionService ext
35+ @@ -83,6 +84 ,52 @@ export class ExtHostExtensionService ext
3836 await interceptor.install();
3937 performance.mark('code/extHost/didInitAPI');
4038
4139+ (async () => {
4240+ const socketPath = process.env['VSCODE_IPC_HOOK_CLI'];
43- + if (!socketPath) {
41+ + const codeServerSocketPath = process.env['CODE_SERVER_SESSION_SOCKET']
42+ + if (!socketPath || !codeServerSocketPath) {
4443+ return;
4544+ }
4645+ const workspace = this._instaService.invokeFunction((accessor) => {
@@ -52,7 +51,6 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.
5251+ socketPath
5352+ };
5453+ const message = JSON.stringify({entry});
55- + const codeServerSocketPath = path.join(os.tmpdir(), 'code-server-ipc.sock');
5654+ await new Promise<void>((resolve, reject) => {
5755+ const opts: _http.RequestOptions = {
5856+ path: '/add-session',
@@ -91,17 +89,15 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
9189===================================================================
9290--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
9391+++ code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
94- @@ -3,6 +3,9 @@
92+ @@ -3,6 +3,7 @@
9593 * Licensed under the MIT License. See License.txt in the project root for license information.
9694 *--------------------------------------------------------------------------------------------*/
9795
98- + import * as os from 'os';
9996+ import * as _http from 'http';
100- + import * as path from 'vs/base/common/path';
10197 import * as nativeWatchdog from 'native-watchdog';
10298 import * as net from 'net';
10399 import * as minimist from 'minimist';
104- @@ -400,7 +403 ,28 @@ async function startExtensionHostProcess
100+ @@ -400,7 +401 ,28 @@ async function startExtensionHostProcess
105101 );
106102
107103 // rewrite onTerminate-function to be a proper shutdown
@@ -110,11 +106,11 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
110106+ extensionHostMain.terminate(reason);
111107+
112108+ const socketPath = process.env['VSCODE_IPC_HOOK_CLI'];
113- + if (!socketPath) {
109+ + const codeServerSocketPath = process.env['CODE_SERVER_SESSION_SOCKET']
110+ + if (!socketPath || !codeServerSocketPath) {
114111+ return;
115112+ }
116113+ const message = JSON.stringify({socketPath});
117- + const codeServerSocketPath = path.join(os.tmpdir(), 'code-server-ipc.sock');
118114+ const opts: _http.RequestOptions = {
119115+ path: '/delete-session',
120116+ socketPath: codeServerSocketPath,
0 commit comments