From 3c557e0491de7c5cb4951e05c80ac7b03df05f22 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 3 Dec 2026 17:41:15 -0900 Subject: [PATCH 1/3] Fix app error test when able to bind on port 2 In our workspaces non-root users have the ability to bind to port 2 so this test fails there. Now the test starts a server so the port will be occupied. --- test/unit/node/app.test.ts | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/test/unit/node/app.test.ts b/test/unit/node/app.test.ts index 618771842a4a..d220e4346e38 100644 --- a/test/unit/node/app.test.ts +++ b/test/unit/node/app.test.ts @@ -2,6 +2,7 @@ import { logger } from "@coder/logger" import { promises } from "fs" import * as http from "http" import * as https from "https" +import * as net from "net" import * as path from "path" import { createApp, ensureAddress, handleArgsSocketCatchError, isFdOpts, listen } from "../../../src/node/app" import { OptionalString, setDefaults } from "../../../src/node/cli" @@ -74,25 +75,19 @@ describe("createApp", () => { }) it("should reject errors that happen before the server can listen", async () => { - // We listen on an invalid port - // causing the app to reject the Promise called at startup - const port = 2 + // Occupy a port to cause the app to reject during startup. + const occupier = http.createServer() + await new Promise((resolve) => occupier.listen(0, "localhost", resolve)) + const port = (occupier.address() as net.AddressInfo).port const defaultArgs = await setDefaults({ port, }) - async function masterBall() { - const app = await createApp(defaultArgs) - - const testError = new Error("Test error") - - app.server.emit("error", testError) - - // Cleanup - app.dispose() + try { + await expect(createApp(defaultArgs)).rejects.toThrow("listen EADDRINUSE") + } finally { + occupier.close() } - - expect(() => masterBall()).rejects.toThrow("listen EACCES: permission denied") }) it("should unlink a socket before listening on the socket", async () => { From 0b85b9ee2829b7c32b6c926ec61ba414c1307e2b Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 3 Dec 2026 17:42:17 -0900 Subject: [PATCH 2/3] Fix open handle from wrapper test The setInterval() was keeping the process alive. --- test/unit/node/wrapper.test.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/unit/node/wrapper.test.ts b/test/unit/node/wrapper.test.ts index 4aa14bda5536..b6c32a84b7a0 100644 --- a/test/unit/node/wrapper.test.ts +++ b/test/unit/node/wrapper.test.ts @@ -2,13 +2,21 @@ import { ChildProcess, ParentProcess, isChild } from "../../../src/node/wrapper" describe("wrapper", () => { describe("isChild", () => { + afterEach(() => { + jest.useRealTimers() + }) + it("should return false for parent process", () => { const p = new ParentProcess("1") expect(isChild(p)).toBe(false) }) - }) - it("should return false for parent process", () => { - const childProc = new ChildProcess(1) - expect(isChild(childProc)).toBe(true) + + it("should return true for child process", () => { + // ChildProcess starts an interval that checks if the parent process is + // alive; use fake timers so it does not outlive the test. + jest.useFakeTimers() + const childProc = new ChildProcess(1) + expect(isChild(childProc)).toBe(true) + }) }) }) From 76c06961f50707bd20496f9f169866af0c91e900 Mon Sep 17 00:00:00 2001 From: cdrci Date: Wed, 2 Dec 2026 16:16:42 +0000 Subject: [PATCH 3/3] Update Code to 1.149.0 Notable changes: - It seems we no longer need the Copilot patch; the default task appears to only keep the necessary dependencies now and handles the native shims. - fs import was removed from serverServices.ts, use pfs instead of adding back the import. Since it does not have `stat`, use `exists`. - The extensions dir no longer has its own workspace and lock files. --- .node-version | 2 +- CHANGELOG.md | 27 ++++ ci/build/build-release.sh | 2 - ci/build/build-vscode.sh | 2 +- lib/vscode | 2 +- patches/app-name.diff | 6 +- patches/base-path.diff | 25 ++-- patches/cli-window-open.diff | 2 +- patches/clipboard.diff | 6 +- patches/copilot.diff | 163 ------------------------ patches/csp-hashes.diff | 8 +- patches/disable-builtin-ext-update.diff | 2 +- patches/disable-file-cache.diff | 14 +- patches/display-language.diff | 28 ++-- patches/external-file-actions.diff | 50 ++++---- patches/getting-started.diff | 26 ++-- patches/integration.diff | 26 ++-- patches/local-storage.diff | 8 +- patches/logout.diff | 8 +- patches/marketplace.diff | 4 +- patches/proposed-api.diff | 2 +- patches/proxy-uri.diff | 6 +- patches/remote-storage.diff | 20 +-- patches/series | 1 - patches/service-worker.diff | 4 +- patches/sourcemaps.diff | 4 +- patches/telemetry.diff | 16 +-- patches/trusted-domains.diff | 8 +- patches/update-check.diff | 10 +- patches/webview.diff | 2 +- 30 files changed, 171 insertions(+), 313 deletions(-) delete mode 100644 patches/copilot.diff diff --git a/.node-version b/.node-version index ce62013c39ae..229b3ce85a63 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -24.22.1 +24.22.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fda676f4e93..a2699f51e49d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,33 @@ Code v99.99.999 ## Unreleased +Code v1.149.0 + +### Added + +- New flag `--cookie-max-age-seconds` that allows persisting the cookie beyond a + single session. + +### Changed + +- Update to Code 1.149.0 +- Paths proxied through the path proxy (`/proxy/{port number}/{path}`) will now + be normalized before being proxied to the application on that port. +- When opening a file from an external command line, code-server looks for an + existing window that has a folder open which contains that file and opens it + there. If no windows contain the file it would error. Now, before erroring + code-server will first check if there is a window open that has no folder + open, and use that window as a fallback to open the file. + +### Fixed + +- Fix a race when opening a remote workspace for the first time that caused the + file explorer to be empty. +- Quoted hosts in the `Forwarded` header will now work. +- Fix a race that could cause code-server to think it was inactive despite + having web sockets actively connected. This affected both the sentinel file + and the idle timeout. + ## [4.146.0](https://github.com/coder/code-server/releases/tag/v4.146.0) - 2026-11-20 Code v1.146.0 diff --git a/ci/build/build-release.sh b/ci/build/build-release.sh index c19ef8eddef2..4c88365bd670 100755 --- a/ci/build/build-release.sh +++ b/ci/build/build-release.sh @@ -161,8 +161,6 @@ bundle_vscode() { # Include global extension dependencies as well. jq 'del(.devDependencies)' "$VSCODE_SRC_PATH/extensions/package.json" > "$VSCODE_OUT_PATH/extensions/package.json" - rsync "$VSCODE_SRC_PATH/extensions/pnpm-lock.yaml" "$VSCODE_OUT_PATH/extensions/pnpm-lock.yaml" - rsync "$VSCODE_SRC_PATH/extensions/pnpm-workspace.yaml" "$VSCODE_OUT_PATH/extensions/pnpm-workspace.yaml" } main "$@" diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index e1152087755f..471ecf5b409a 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -119,7 +119,7 @@ EOF ) > product.json - VSCODE_QUALITY=stable pnpm run gulp compile-copilot-extension-full-build + VSCODE_QUALITY=stable pnpm run gulp compile-copilot-extension-build pnpm run gulp core-ci pnpm run gulp "vscode-reh-web-$VSCODE_TARGET${MINIFY:+-min}-ci" diff --git a/lib/vscode b/lib/vscode index 69047191fc42..fd90a6deb021 160000 --- a/lib/vscode +++ b/lib/vscode @@ -1 +1 @@ -Subproject commit 69047191fc427f2f92828279aae1d90d8eeda7ab +Subproject commit fd90a6deb021003d28f232fd2199a70348aa3d28 diff --git a/patches/app-name.diff b/patches/app-name.diff index 2d6d6a0e28b3..a6c81dbf9c8f 100644 --- a/patches/app-name.diff +++ b/patches/app-name.diff @@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -40,6 +40,7 @@ export const serverOptions: OptionDescri +@@ -38,6 +38,7 @@ export const serverOptions: OptionDescri 'disable-getting-started-override': { type: 'boolean' }, 'locale': { type: 'string' }, 'link-protection-trusted-domains': { type: 'string[]' }, @@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -140,6 +141,7 @@ export interface ServerParsedArgs { +@@ -139,6 +140,7 @@ export interface ServerParsedArgs { 'disable-getting-started-override'?: boolean, 'locale'?: string 'link-protection-trusted-domains'?: string[], @@ -32,7 +32,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -407,8 +407,11 @@ export class WebClientServer { +@@ -430,8 +430,11 @@ export class WebClientServer { linkProtectionTrustedDomains.push(...this._productService.linkProtectionTrustedDomains); } diff --git a/patches/base-path.diff b/patches/base-path.diff index 681407d6b40a..1df4f3f29a10 100644 --- a/patches/base-path.diff +++ b/patches/base-path.diff @@ -111,7 +111,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -146,7 +146,7 @@ export function createWorkbenchContentSe +@@ -147,7 +147,7 @@ export function createWorkbenchContentSe 'default-src \'self\';', 'img-src \'self\' https: data: blob:;', 'media-src \'self\';', @@ -120,19 +120,18 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts 'child-src \'self\';', `frame-src 'self' https://*.vscode-cdn.net data:;`, 'worker-src \'self\' data: blob:;', -@@ -307,8 +307,10 @@ export class WebClientServer { - }; - +@@ -331,7 +331,9 @@ export class WebClientServer { + */ + private async _handleRoot(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: URL): Promise { // Prefix routes with basePath for clients +- const basePath = this._getEffectiveBasePath(req); + const rootBase = relativeRoot(getOriginalUrl(req)) + const vscodeBase = relativePath(getOriginalUrl(req)) - const forwardedPrefix = getFirstHeader('x-forwarded-prefix'); -- const basePath = forwardedPrefix && isSafeBasePath(forwardedPrefix) ? forwardedPrefix : this._basePath; -+ const basePath = vscodeBase || (forwardedPrefix && isSafeBasePath(forwardedPrefix) ? forwardedPrefix : this._basePath); ++ const basePath = vscodeBase || this._getEffectiveBasePath(req); const queryConnectionTokens = parsedUrl.searchParams.getAll(connectionTokenQueryName); if (queryConnectionTokens.length === 1) { -@@ -345,10 +347,14 @@ export class WebClientServer { +@@ -368,10 +370,14 @@ export class WebClientServer { }; const useTestResolver = (!this._environmentService.isBuilt && !!this._environmentService.args['use-test-resolver']); @@ -143,12 +142,12 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts let remoteAuthority = ( useTestResolver ? 'test+test' -- : (getFirstHeader('x-original-host') || getFirstHeader('x-forwarded-host') || req.headers.host) +- : (this._getFirstHeader(req, 'x-original-host') || this._getFirstHeader(req, 'x-forwarded-host') || req.headers.host) + : 'remote' ); if (!remoteAuthority) { return serveError(req, res, 400, `Bad request.`); -@@ -395,6 +401,7 @@ export class WebClientServer { +@@ -418,6 +424,7 @@ export class WebClientServer { const productConfiguration: Partial> = { codeServerVersion: this._productService.codeServerVersion, @@ -156,7 +155,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts embedderIdentifier: 'server-distro', voiceWsUrl: this._productService.voiceWsUrl, extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? { -@@ -446,7 +453,9 @@ export class WebClientServer { +@@ -469,7 +476,9 @@ export class WebClientServer { WORKBENCH_WEB_BASE_URL: staticRoute, WORKBENCH_NLS_URL, WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`, @@ -167,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts }; // DEV --------------------------------------------------------------------------------------- -@@ -542,3 +551,70 @@ export class WebClientServer { +@@ -578,3 +587,70 @@ export class WebClientServer { return void res.end(data); } } @@ -242,7 +241,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts -@@ -98,6 +98,7 @@ export interface IDictationRuntimeProduc +@@ -118,6 +118,7 @@ export interface IDictationRuntimeProduc export interface IProductConfiguration { readonly codeServerVersion?: string diff --git a/patches/cli-window-open.diff b/patches/cli-window-open.diff index 7b220838a044..a7a60f89ee7d 100644 --- a/patches/cli-window-open.diff +++ b/patches/cli-window-open.diff @@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts -@@ -108,10 +108,14 @@ class RemoteTerminalBackend extends Base +@@ -109,10 +109,14 @@ class RemoteTerminalBackend extends Base } const reqId = e.reqId; const commandId = e.commandId; diff --git a/patches/clipboard.diff b/patches/clipboard.diff index 5517d968e054..e584ef49c68f 100644 --- a/patches/clipboard.diff +++ b/patches/clipboard.diff @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js'; import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js'; import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js'; -@@ -96,6 +97,11 @@ CommandsRegistry.registerCommand('_remot +@@ -98,6 +99,11 @@ CommandsRegistry.registerCommand('_remot }); @@ -65,7 +65,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts -@@ -99,7 +99,7 @@ class RemoteTerminalBackend extends Base +@@ -100,7 +100,7 @@ class RemoteTerminalBackend extends Base } })); @@ -78,7 +78,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts +++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts -@@ -148,6 +148,7 @@ export interface NativeParsedArgs { +@@ -149,6 +149,7 @@ export interface NativeParsedArgs { 'disable-chromium-sandbox'?: boolean; sandbox?: boolean; 'enable-coi'?: boolean; diff --git a/patches/copilot.diff b/patches/copilot.diff deleted file mode 100644 index 0ee8a720ffb8..000000000000 --- a/patches/copilot.diff +++ /dev/null @@ -1,163 +0,0 @@ -Index: code-server/lib/vscode/build/gulpfile.extensions.ts -=================================================================== ---- code-server.orig/lib/vscode/build/gulpfile.extensions.ts -+++ code-server/lib/vscode/build/gulpfile.extensions.ts -@@ -282,6 +282,29 @@ export const compileCopilotExtensionBuil - task.task(compileCopilotExtensionBuildTask); - - /** -+ * Compiles the built-in copilot extension with proper `.vscodeignore` filtering -+ * and materializes native dependency shims (`node-pty`, `ripgrep`). -+ * Produces output equivalent to what CI ships from the pre-built VSIX. -+ * -+ * The result is placed in `.build/extensions/copilot/` and can be copied -+ * directly into a VS Code Insiders installation at: -+ * `/resources/app/extensions/copilot/` -+ */ -+export const compileCopilotExtensionFullBuildTask = task.define('compile-copilot-extension-full-build', task.series( -+ // Step 1: Clean previous copilot build output -+ task.define('clean-copilot-build', util.rimraf('.build/extensions/copilot')), -+ // Step 2: Build and package with proper `.vscodeignore` filtering -+ task.define('package-copilot-extension-full', () => ext.packageCopilotExtensionFullStream().pipe(gulp.dest('.build'))), -+ // Step 3: Materialize native dependency shims (`node-pty`, `ripgrep`) -+ task.define('copilot-extension-native-shims', () => { -+ const copilotExtDir = path.join(root, '.build', 'extensions', 'copilot'); -+ ext.prepareCopilotExtensionNativeShims(copilotExtDir); -+ return Promise.resolve(); -+ }) -+)); -+task.task(compileCopilotExtensionFullBuildTask); -+ -+/** - * Compiles the extensions for the build. - * This is essentially a helper task that combines {@link cleanExtensionsBuildTask}, {@link compileNonNativeExtensionsBuildTask} and {@link compileNativeExtensionsBuildTask} - */ -Index: code-server/lib/vscode/build/lib/extensions.ts -=================================================================== ---- code-server.orig/lib/vscode/build/lib/extensions.ts -+++ code-server/lib/vscode/build/lib/extensions.ts -@@ -21,6 +21,7 @@ import { getProductionDependencies } fro - import { type IExtensionDefinition, getExtensionStream } from './builtInExtensions.ts'; - import { fetchUrls, fetchGithub } from './fetch.ts'; - import { createTsgoStream, spawnTsgo } from './tsgo.ts'; -+import { prepareBuiltInCopilotRipgrepShim } from './copilot.ts'; - import watcher from './watch/index.ts'; - - import { createRequire } from 'module'; -@@ -570,6 +571,116 @@ export function packageCopilotExtensionS - ).pipe(util2.setExecutableBit(['**/*.sh'])); - } - -+/** -+ * Package the built-in copilot extension as a properly filtered VSIX-equivalent. -+ * Unlike {@link packageCopilotExtensionStream}, this uses vsce.listFiles with -+ * PackageManager.Npm so that .vscodeignore is respected for dependency filtering, -+ * producing output equivalent to what CI ships from the pre-built VSIX. -+ */ -+export function packageCopilotExtensionFullStream(): Stream { -+ const vsce = require('@vscode/vsce') as typeof import('@vscode/vsce'); -+ const extensionPath = path.join(root, 'extensions', 'copilot'); -+ if (!fs.existsSync(extensionPath)) { -+ return es.readArray([]); -+ } -+ -+ const esbuildConfigFileName = '.esbuild.mts'; -+ const esbuildScript = path.join(extensionPath, esbuildConfigFileName); -+ if (!fs.existsSync(esbuildScript)) { -+ throw new Error(`Copilot esbuild script not found at ${esbuildScript}`); -+ } -+ -+ const result = es.through(); -+ -+ // Step 1: Run esbuild to compile the extension -+ new Promise((resolve, reject) => { -+ const proc = cp.execFile(process.argv[0], [esbuildScript], { cwd: extensionPath }, (error, _stdout, stderr) => { -+ if (error) { -+ return reject(error); -+ } -+ const matches = (stderr || '').match(/\> (.+): error: (.+)?/g); -+ fancyLog(`Bundled extension: ${ansiColors.yellow(path.join('copilot', esbuildConfigFileName))} with ${matches ? matches.length : 0} errors.`); -+ for (const match of matches || []) { -+ fancyLog.error(match); -+ } -+ return resolve(); -+ }); -+ proc.stdout!.on('data', (data) => { -+ fancyLog(`${ansiColors.green('esbuilding copilot')}: ${data.toString('utf8')}`); -+ }); -+ }).then(() => { -+ // Step 2: Use `vsce.listFiles` with Npm package manager so `.vscodeignore` -+ // is applied to both source files AND `node_modules` dependencies. -+ // This is the key difference from `packageCopilotExtensionStream` which -+ // uses `PackageManager.None` and then blindly merges all production deps. -+ return vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Npm }); -+ }).then(fileNames => { -+ const files = fileNames -+ .map(fileName => path.join(extensionPath, fileName)) -+ .map(filePath => new File({ -+ path: filePath, -+ stat: fs.statSync(filePath), -+ base: extensionPath, -+ contents: fs.createReadStream(filePath) -+ })); -+ -+ es.readArray(files).pipe(result); -+ }).catch(err => { -+ console.error('Failed to package copilot extension:', err); -+ result.emit('error', err); -+ }); -+ -+ // Apply the same package.json cleanup as bundled extensions get -+ const cleaned = updateExtensionPackageJSON( -+ result.pipe(rename(p => p.dirname = `extensions/copilot/${p.dirname}`)), -+ (data: any) => { -+ delete data.scripts; -+ delete data.dependencies; -+ delete data.devDependencies; -+ if (data.main) { -+ data.main = data.main.replace('/out/', '/dist/'); -+ } -+ return data; -+ } -+ ); -+ -+ return minifyExtensionResources(cleaned) -+ .pipe(util2.setExecutableBit(['**/*.sh'])); -+} -+ -+/** -+ * Materializes native dependency shims (`node-pty`, `ripgrep`) into the copilot -+ * extension output at {@link outputDir}. Uses the root `node_modules` as the -+ * source for native binaries, targeting the current platform/arch. -+ * -+ * This is the equivalent of what {@link copyCopilotNativeDepsTask} in -+ * `gulpfile.vscode.ts` does during a full product build, but scoped to -+ * just the standalone copilot extension output. -+ * -+ * Failures are logged as warnings rather than throwing, since the copilot -+ * extension can still create shims at runtime if they are missing. -+ */ -+export function prepareCopilotExtensionNativeShims(outputDir: string): void { -+ const platform = process.platform; -+ const arch = process.arch; -+ const appNodeModulesDir = path.join(root, 'node_modules'); -+ -+ if (!fs.existsSync(outputDir)) { -+ fancyLog.warn('[prepareCopilotExtensionNativeShims] Copilot extension not found at', outputDir, '- skipping shims'); -+ return; -+ } -+ -+ try { -+ prepareBuiltInCopilotRipgrepShim(platform, arch, outputDir, appNodeModulesDir); -+ fancyLog(`[prepareCopilotExtensionNativeShims] Materialized native shims for ${platform}-${arch}`); -+ } catch (err) { -+ // Downgrade to a warning for local builds since the extension -+ // can still function without shims (it creates them at runtime). -+ fancyLog.warn(`[prepareCopilotExtensionNativeShims] Failed to materialize shims: ${err}`); -+ fancyLog.warn('[prepareCopilotExtensionNativeShims] The extension will still work but will create shims at runtime.'); -+ } -+} -+ - export function packageMarketplaceExtensionsStream(forWeb: boolean): Stream { - const marketplaceExtensionsDescriptions = [ - ...builtInExtensions.filter(({ name }) => (forWeb ? !marketplaceWebExtensionsExclude.has(name) : true)), diff --git a/patches/csp-hashes.diff b/patches/csp-hashes.diff index 603a23eb6712..80d7a225b02e 100644 --- a/patches/csp-hashes.diff +++ b/patches/csp-hashes.diff @@ -6,8 +6,8 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index -+ content="default-src 'none'; script-src 'sha256-PrK0S1PGjGJseEIewxhvBTIw2x6Ci21IJIkOZ3gFWMg=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> +- content="default-src 'none'; script-src 'sha256-97WXP4i2DCe9NvOvmdswZ6mW9H6FFmvxaldj0ljQcrs=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> ++ content="default-src 'none'; script-src 'sha256-VBjXCqpatjNeC5+MxpODxz0CVabmhhsAMMAkN9wD6N0=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> id.toLowerCase() === this.identifier.id.toLowerCase())) { return false; } diff --git a/patches/disable-file-cache.diff b/patches/disable-file-cache.diff index 550a869459a6..a19bed8af004 100644 --- a/patches/disable-file-cache.diff +++ b/patches/disable-file-cache.diff @@ -49,7 +49,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -37,6 +37,7 @@ export const serverOptions: OptionDescri +@@ -35,6 +35,7 @@ export const serverOptions: OptionDescri 'auth': { type: 'string' }, 'disable-file-downloads': { type: 'boolean' }, 'disable-file-uploads': { type: 'boolean' }, @@ -57,7 +57,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts 'disable-getting-started-override': { type: 'boolean' }, 'locale': { type: 'string' }, 'link-protection-trusted-domains': { type: 'string[]' }, -@@ -139,6 +140,7 @@ export interface ServerParsedArgs { +@@ -138,6 +139,7 @@ export interface ServerParsedArgs { 'auth'?: string; 'disable-file-downloads'?: boolean; 'disable-file-uploads'?: boolean; @@ -69,7 +69,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -442,6 +442,7 @@ export class WebClientServer { +@@ -465,6 +465,7 @@ export class WebClientServer { userDataPath: this._environmentService.userDataPath, isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'], isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'], @@ -114,7 +114,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/webviewEl import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js'; import { IRemoteAgentService } from '../../../services/remote/common/remoteAgentService.js'; import { decodeAuthority, webviewGenericCspSource, webviewMouseActivityEvent, webviewRootResourceAuthority } from '../common/webview.js'; -@@ -869,6 +870,8 @@ export class WebviewElement extends Disp +@@ -900,6 +901,8 @@ export class WebviewElement extends Disp const rangeHeader = range ? `bytes ${range.start}-${rangeEnd}/${result.size}` : undefined; @@ -123,7 +123,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/webviewEl if (WebviewElement._supportsTransferableStreams.value) { let controller: ReadableStreamDefaultController> | undefined; let closed = false; -@@ -920,7 +923,7 @@ export class WebviewElement extends Disp +@@ -951,7 +954,7 @@ export class WebviewElement extends Disp status: range ? 206 : 200, path: uri.path, mime: result.mimeType, @@ -132,7 +132,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/webviewEl mtime: result.mtime, range: rangeHeader, stream, -@@ -932,7 +935,7 @@ export class WebviewElement extends Disp +@@ -963,7 +966,7 @@ export class WebviewElement extends Disp status: range ? 206 : 200, path: uri.path, mime: result.mimeType, @@ -141,7 +141,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/webviewEl mtime: result.mtime, range: rangeHeader, }); -@@ -989,6 +992,14 @@ export class WebviewElement extends Disp +@@ -1020,6 +1023,14 @@ export class WebviewElement extends Disp }); } diff --git a/patches/display-language.diff b/patches/display-language.diff index 437f139584f1..fbd83cbc6230 100644 --- a/patches/display-language.diff +++ b/patches/display-language.diff @@ -9,16 +9,16 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts +++ code-server/lib/vscode/src/vs/server/node/serverServices.ts -@@ -13,7 +13,7 @@ import { IURITransformer } from '../../b - import { generateUuid } from '../../base/common/uuid.js'; +@@ -14,7 +14,7 @@ import { generateUuid } from '../../base import { getMachineId, getSqmMachineId, getDevDeviceId } from '../../base/node/id.js'; import { Promises } from '../../base/node/pfs.js'; + import { findFreePortFaster } from '../../base/node/ports.js'; -import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js'; -+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from '../../base/parts/ipc/common/ipc.js'; ++import { ProxyChannel, ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js'; import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js'; - import { createRandomIPCHandle } from '../../base/parts/ipc/node/ipc.net.js'; import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; -@@ -444,6 +444,9 @@ export async function setupServerService + import { ConfigurationService } from '../../platform/configuration/common/configurationService.js'; +@@ -418,6 +418,9 @@ export async function setupServerService socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority))); @@ -32,7 +32,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/environmentServ =================================================================== --- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts +++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts -@@ -98,7 +98,7 @@ export abstract class AbstractNativeEnvi +@@ -104,7 +104,7 @@ export abstract class AbstractNativeEnvi return URI.file(join(vscodePortable, 'argv.json')); } @@ -161,7 +161,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts import { CharCode } from '../../base/common/charCode.js'; import { IExtensionManifest } from '../../platform/extensions/common/extensions.js'; import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js'; -@@ -442,14 +443,22 @@ export class WebClientServer { +@@ -465,14 +466,22 @@ export class WebClientServer { }; const cookies = cookie.parse(req.headers.cookie || ''); @@ -190,7 +190,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -38,6 +38,7 @@ export const serverOptions: OptionDescri +@@ -36,6 +36,7 @@ export const serverOptions: OptionDescri 'disable-file-downloads': { type: 'boolean' }, 'disable-file-uploads': { type: 'boolean' }, 'disable-getting-started-override': { type: 'boolean' }, @@ -198,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -136,6 +137,7 @@ export interface ServerParsedArgs { +@@ -135,6 +136,7 @@ export interface ServerParsedArgs { 'disable-file-downloads'?: boolean; 'disable-file-uploads'?: boolean; 'disable-getting-started-override'?: boolean, @@ -282,7 +282,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens if (this.extension.state !== ExtensionState.Uninstalled) { return; } -@@ -832,7 +829,7 @@ export abstract class InstallInOtherServ +@@ -835,7 +832,7 @@ export abstract class InstallInOtherServ } if (isLanguagePackExtension(this.extension.local.manifest)) { @@ -291,7 +291,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens } // Prefers to run on UI -@@ -2337,17 +2334,6 @@ export class SetLanguageAction extends E +@@ -2374,17 +2371,6 @@ export class SetLanguageAction extends E update(): void { this.enabled = false; this.class = SetLanguageAction.DisabledClass; @@ -309,7 +309,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens } override async run(): Promise { -@@ -2364,7 +2350,6 @@ export class ClearLanguageAction extends +@@ -2401,7 +2387,6 @@ export class ClearLanguageAction extends private static readonly DisabledClass = `${this.EnabledClass} disabled`; constructor( @@ -317,7 +317,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens @ILocaleService private readonly localeService: ILocaleService, ) { super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false); -@@ -2374,17 +2359,6 @@ export class ClearLanguageAction extends +@@ -2411,17 +2396,6 @@ export class ClearLanguageAction extends update(): void { this.enabled = false; this.class = ClearLanguageAction.DisabledClass; @@ -339,7 +339,7 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts +++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts -@@ -55,7 +55,7 @@ import './services/host/browser/browserH +@@ -56,7 +56,7 @@ import './services/host/browser/browserH import '../platform/meteredConnection/browser/meteredConnectionService.js'; import './services/lifecycle/browser/lifecycleService.js'; import './services/clipboard/browser/clipboardService.js'; diff --git a/patches/external-file-actions.diff b/patches/external-file-actions.diff index 694306367d24..d1a8567a63e6 100644 --- a/patches/external-file-actions.diff +++ b/patches/external-file-actions.diff @@ -90,7 +90,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -35,6 +35,8 @@ export const serverOptions: OptionDescri +@@ -33,6 +33,8 @@ export const serverOptions: OptionDescri /* ----- code-server ----- */ 'disable-update-check': { type: 'boolean' }, 'auth': { type: 'string' }, @@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -130,6 +132,8 @@ export interface ServerParsedArgs { +@@ -129,6 +131,8 @@ export interface ServerParsedArgs { /* ----- code-server ----- */ 'disable-update-check'?: boolean; 'auth'?: string; @@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -425,6 +425,8 @@ export class WebClientServer { +@@ -448,6 +448,8 @@ export class WebClientServer { serverBasePath: basePath, webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', userDataPath: this._environmentService.userDataPath, @@ -129,16 +129,16 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts import { Disposable } from '../../base/common/lifecycle.js'; import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js'; import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext, IsChromeOSContext } from '../../platform/contextkey/common/contextkeys.js'; --import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SecondarySideBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js'; -+import { IsEnabledFileDownloads, IsEnabledFileUploads, SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SecondarySideBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js'; +-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SecondarySideBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, ChatPartEnabledContext, ChatPartVisibleContext, EditorAreaHiddenByChatContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkspaceHasVirtualContentContext, WorkbenchStateContext, WorkbenchScopeContext, WorkbenchModeContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, AuxiliaryBarMaximizeHiddenContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js'; ++import { IsEnabledFileDownloads, IsEnabledFileUploads, SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SecondarySideBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, ChatPartEnabledContext, ChatPartVisibleContext, EditorAreaHiddenByChatContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkspaceHasVirtualContentContext, WorkbenchStateContext, WorkbenchScopeContext, WorkbenchModeContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, AuxiliaryBarMaximizeHiddenContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js'; import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js'; import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; -import { IWorkbenchEnvironmentService } from '../services/environment/common/environmentService.js'; +import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js'; - import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js'; + import { WorkbenchState, WorkbenchMode, IWorkspaceContextService, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js'; import { IWorkbenchLayoutService, Parts, positionToString } from '../services/layout/browser/layoutService.js'; import { getRemoteName } from '../../platform/remote/common/remoteHosts.js'; -@@ -70,7 +70,7 @@ export class WorkbenchContextKeysHandler +@@ -77,7 +77,7 @@ export class WorkbenchContextKeysHandler @IContextKeyService private readonly contextKeyService: IContextKeyService, @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -147,9 +147,9 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts @IProductService private readonly productService: IProductService, @IEditorGroupsService private readonly editorGroupService: IEditorGroupsService, @IEditorService private readonly editorService: IEditorService, -@@ -206,6 +206,10 @@ export class WorkbenchContextKeysHandler - this.auxiliaryBarMaximizedContext = AuxiliaryBarMaximizedContext.bindTo(this.contextKeyService); - this.auxiliaryBarMaximizedContext.set(this.layoutService.isAuxiliaryBarMaximized()); +@@ -229,6 +229,10 @@ export class WorkbenchContextKeysHandler + this.auxiliaryBarMaximizeHiddenContext = AuxiliaryBarMaximizeHiddenContext.bindTo(this.contextKeyService); + this.auxiliaryBarMaximizeHiddenContext.set(this.layoutService.isAuxiliaryBarMaximizeHidden()); + // code-server + IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true) @@ -166,12 +166,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions import { AutoSaveAfterShortDelayContext } from '../../../services/filesConfiguration/common/filesConfigurationService.js'; import { WorkbenchListDoubleSelection } from '../../../../platform/list/browser/listService.js'; import { Schemas } from '../../../../base/common/network.js'; --import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsSessionsWindowContext, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ActiveEditorDirtyContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js'; -+import { IsEnabledFileDownloads, IsEnabledFileUploads, DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsSessionsWindowContext, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ActiveEditorDirtyContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js'; +-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsSessionsWindowContext, WorkbenchModeContext, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ActiveEditorDirtyContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js'; ++import { IsEnabledFileDownloads, IsEnabledFileUploads, DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsSessionsWindowContext, WorkbenchModeContext, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ActiveEditorDirtyContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js'; import { IsWebContext } from '../../../../platform/contextkey/common/contextkeys.js'; import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; import { ThemeIcon } from '../../../../base/common/themables.js'; -@@ -590,13 +590,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo +@@ -593,13 +593,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo id: DOWNLOAD_COMMAND_ID, title: DOWNLOAD_LABEL }, @@ -195,7 +195,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions ) })); -@@ -608,6 +611,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo +@@ -611,6 +614,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo title: UPLOAD_LABEL, }, when: ContextKeyExpr.and( @@ -207,7 +207,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts +++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts -@@ -42,6 +42,9 @@ export const EmbedderIdentifierContext = +@@ -46,6 +46,9 @@ export const EmbedderIdentifierContext = export const InAutomationContext = new RawContextKey('inAutomation', false, localize('inAutomation', "Whether VS Code is running under automation/smoke test")); @@ -230,7 +230,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js'; import { IContextKeyService, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; import { equalsIgnoreCase, format, startsWithIgnoreCase } from '../../../../base/common/strings.js'; -@@ -153,7 +153,7 @@ export class SimpleFileDialog extends Di +@@ -154,7 +154,7 @@ export class SimpleFileDialog extends Di @IFileDialogService private readonly fileDialogService: IFileDialogService, @IModelService private readonly modelService: IModelService, @ILanguageService private readonly languageService: ILanguageService, @@ -239,7 +239,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi @IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService, @IPathService protected readonly pathService: IPathService, @IKeybindingService private readonly keybindingService: IKeybindingService, -@@ -372,21 +372,23 @@ export class SimpleFileDialog extends Di +@@ -373,21 +373,23 @@ export class SimpleFileDialog extends Di : nls.localize('remoteFileDialog.placeholder', "Folder path"); this.filePickBox.ok = true; this.filePickBox.okLabel = typeof this.options.openLabel === 'string' ? this.options.openLabel : this.options.openLabel?.withoutMnemonic; @@ -290,7 +290,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo import { WorkbenchCompressibleAsyncDataTree } from '../../../../../platform/list/browser/listService.js'; import { ISearchService, QueryType, getExcludes, ISearchConfiguration, ISearchComplete, IFileQuery } from '../../../../services/search/common/search.js'; import { CancellationToken } from '../../../../../base/common/cancellation.js'; -@@ -1562,7 +1563,8 @@ export class FileDragAndDrop implements +@@ -1567,7 +1568,8 @@ export class FileDragAndDrop implements @IConfigurationService private configurationService: IConfigurationService, @IInstantiationService private instantiationService: IInstantiationService, @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, @@ -300,7 +300,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo ) { const updateDropEnablement = (e: IConfigurationChangeEvent | undefined) => { if (!e || e.affectsConfiguration('explorer.enableDragAndDrop')) { -@@ -1787,15 +1789,17 @@ export class FileDragAndDrop implements +@@ -1792,15 +1794,17 @@ export class FileDragAndDrop implements // External file DND (Import/Upload file) if (data instanceof NativeDragAndDropData) { @@ -331,15 +331,15 @@ Index: code-server/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderS =================================================================== --- code-server.orig/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderServer.ts +++ code-server/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderServer.ts -@@ -100,6 +100,7 @@ export abstract class AbstractDiskFileSy - - private async readFile(uriTransformer: IURITransformer, _resource: UriComponents, opts?: IFileAtomicReadOptions): Promise { +@@ -103,6 +103,7 @@ export abstract class AbstractDiskFileSy const resource = this.transformIncoming(uriTransformer, _resource, true); + + // The token cancels when the client goes away, which stops waiting for a named pipe + this.logService.trace(`File action: readFile ${resource.path}`); - const buffer = await this.provider.readFile(resource, opts); + const buffer = await this.provider.readFile(resource, opts, token); return VSBuffer.wrap(buffer); -@@ -118,6 +119,7 @@ export abstract class AbstractDiskFileSy +@@ -121,6 +122,7 @@ export abstract class AbstractDiskFileSy } }); @@ -347,7 +347,7 @@ Index: code-server/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderS const fileStream = this.provider.readFileStream(resource, opts, cts.token); listenStream(fileStream, { onData: chunk => emitter.fire(VSBuffer.wrap(chunk)), -@@ -138,7 +140,7 @@ export abstract class AbstractDiskFileSy +@@ -142,7 +144,7 @@ export abstract class AbstractDiskFileSy private writeFile(uriTransformer: IURITransformer, _resource: UriComponents, content: VSBuffer, opts: IFileWriteOptions): Promise { const resource = this.transformIncoming(uriTransformer, _resource); diff --git a/patches/getting-started.diff b/patches/getting-started.diff index 8f757d2271ad..53308153449f 100644 --- a/patches/getting-started.diff +++ b/patches/getting-started.diff @@ -14,12 +14,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ --import { $, Dimension, addDisposableListener, append, clearNode, reset } from '../../../../base/browser/dom.js'; -+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from '../../../../base/browser/dom.js'; +-import { $, Dimension, addDisposableListener, append, clearNode, getActiveElement, isAncestorOfActiveElement, isHTMLElement, reset } from '../../../../base/browser/dom.js'; ++import { $, Dimension, addDisposableListener, append, clearNode, getActiveElement, isAncestorOfActiveElement, isHTMLElement, reset, prepend } from '../../../../base/browser/dom.js'; import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js'; import { status } from '../../../../base/browser/ui/aria/aria.js'; import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; -@@ -56,7 +56,7 @@ import { IRecentFolder, IRecentWorkspace +@@ -57,7 +57,7 @@ import { IRecentFolder, IRecentWorkspace import { OpenRecentAction } from '../../../browser/actions/windowActions.js'; import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from '../../../browser/actions/workspaceActions.js'; import { EditorPane } from '../../../browser/parts/editor/editorPane.js'; @@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js'; import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js'; import './gettingStartedColors.js'; -@@ -944,6 +944,72 @@ export class GettingStartedPage extends +@@ -953,6 +953,72 @@ export class GettingStartedPage extends $('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved")) ); @@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro const leftColumn = $('.categories-column.categories-column-left', {},); const rightColumn = $('.categories-column.categories-column-right', {},); -@@ -999,6 +1065,9 @@ export class GettingStartedPage extends +@@ -1029,6 +1095,9 @@ export class GettingStartedPage extends recentList.setLimit(5); reset(leftColumn, startList.getDomElement(), recentList.getDomElement()); } @@ -115,7 +115,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css +++ code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css -@@ -68,6 +68,15 @@ +@@ -82,6 +82,15 @@ display: block; } @@ -181,7 +181,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -37,6 +37,7 @@ export const serverOptions: OptionDescri +@@ -35,6 +35,7 @@ export const serverOptions: OptionDescri 'auth': { type: 'string' }, 'disable-file-downloads': { type: 'boolean' }, 'disable-file-uploads': { type: 'boolean' }, @@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -134,6 +135,7 @@ export interface ServerParsedArgs { +@@ -133,6 +134,7 @@ export interface ServerParsedArgs { 'auth'?: string; 'disable-file-downloads'?: boolean; 'disable-file-uploads'?: boolean; @@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -429,6 +429,7 @@ export class WebClientServer { +@@ -452,6 +452,7 @@ export class WebClientServer { userDataPath: this._environmentService.userDataPath, isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'], isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'], @@ -217,12 +217,12 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts import { Disposable } from '../../base/common/lifecycle.js'; import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js'; import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext, IsChromeOSContext } from '../../platform/contextkey/common/contextkeys.js'; --import { IsEnabledFileDownloads, IsEnabledFileUploads, SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SecondarySideBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js'; -+import { IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SecondarySideBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js'; +-import { IsEnabledFileDownloads, IsEnabledFileUploads, SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SecondarySideBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, ChatPartEnabledContext, ChatPartVisibleContext, EditorAreaHiddenByChatContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkspaceHasVirtualContentContext, WorkbenchStateContext, WorkbenchScopeContext, WorkbenchModeContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, AuxiliaryBarMaximizeHiddenContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js'; ++import { IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SecondarySideBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, ChatPartEnabledContext, ChatPartVisibleContext, EditorAreaHiddenByChatContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkspaceHasVirtualContentContext, WorkbenchStateContext, WorkbenchScopeContext, WorkbenchModeContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, AuxiliaryBarMaximizeHiddenContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js'; import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js'; import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js'; -@@ -209,6 +209,7 @@ export class WorkbenchContextKeysHandler +@@ -232,6 +232,7 @@ export class WorkbenchContextKeysHandler // code-server IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true) IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true) @@ -234,7 +234,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts +++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts -@@ -44,6 +44,7 @@ export const InAutomationContext = new R +@@ -48,6 +48,7 @@ export const InAutomationContext = new R export const IsEnabledFileDownloads = new RawContextKey('isEnabledFileDownloads', true, true); export const IsEnabledFileUploads = new RawContextKey('isEnabledFileUploads', true, true); diff --git a/patches/integration.diff b/patches/integration.diff index 163ce4aacaac..f1e53d6a43f9 100644 --- a/patches/integration.diff +++ b/patches/integration.diff @@ -19,8 +19,8 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts import { parseArgs, ErrorReporter } from '../../platform/environment/node/argv.js'; import { join, dirname } from '../../base/common/path.js'; import { performance } from 'perf_hooks'; --import { agentHostBridgeConnectionTokenEnvironmentVariable, serverOptions } from './serverEnvironmentService.js'; -+import { agentHostBridgeConnectionTokenEnvironmentVariable, serverOptions, ServerParsedArgs } from './serverEnvironmentService.js'; +-import { serverOptions } from './serverEnvironmentService.js'; ++import { serverOptions, ServerParsedArgs } from './serverEnvironmentService.js'; import product from '../../platform/product/common/product.js'; import * as perf from '../../base/common/performance.js'; @@ -29,8 +29,8 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts }; -const args = parseArgs(process.argv.slice(2), serverOptions, errorReporter); --const agentHostBridgeConnectionToken = process.env[agentHostBridgeConnectionTokenEnvironmentVariable]; --delete process.env[agentHostBridgeConnectionTokenEnvironmentVariable]; +-// CLIs set this for servers that predate agent host discovery through the endpoint registry; keep it from child processes. +-delete process.env['VSCODE_AGENT_HOST_BRIDGE_CONNECTION_TOKEN']; - -const REMOTE_DATA_FOLDER = args['server-data-dir'] || process.env['VSCODE_AGENT_FOLDER'] || join(os.homedir(), product.serverDataFolderName || '.vscode-remote'); -const USER_DATA_PATH = args['user-data-dir'] || join(REMOTE_DATA_FOLDER, 'data'); @@ -91,21 +91,21 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts * invoked by server-main.js */ -export function createServer(address: string | net.AddressInfo | null): Promise { -- return doCreateServer(address, args, REMOTE_DATA_FOLDER, agentHostBridgeConnectionToken); +- return doCreateServer(address, args, REMOTE_DATA_FOLDER); +function createServer(address: string | net.AddressInfo | null, args = parse()): Promise { -+ const agentHostBridgeConnectionToken = process.env[agentHostBridgeConnectionTokenEnvironmentVariable]; -+ delete process.env[agentHostBridgeConnectionTokenEnvironmentVariable]; -+ return doCreateServer(address, args, createDirs(args), agentHostBridgeConnectionToken); ++ // CLIs set this for servers that predate agent host discovery through the endpoint registry; keep it from child processes. ++ delete process.env['VSCODE_AGENT_HOST_BRIDGE_CONNECTION_TOKEN']; ++ return doCreateServer(address, args, createDirs(args)); } + +// The aliases prevent the names getting mangled during minification which would -+// make it difficult to import. ++// make them difficult to import. +export { spawnCli as spawnCli, createServer as createServer }; Index: code-server/lib/vscode/src/vs/base/common/processes.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/processes.ts +++ code-server/lib/vscode/src/vs/base/common/processes.ts -@@ -111,6 +111,8 @@ export function sanitizeProcessEnvironme +@@ -129,6 +129,8 @@ export function sanitizeProcessEnvironme /^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/, /^SNAP(|_.*)$/, /^GDK_PIXBUF_.+$/, @@ -177,7 +177,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts import { IProgressService } from '../../platform/progress/common/progress.js'; import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js'; import { dirname, joinPath } from '../../base/common/resources.js'; -@@ -143,6 +144,9 @@ export class BrowserMain extends Disposa +@@ -144,6 +145,9 @@ export class BrowserMain extends Disposa // Startup const instantiationService = workbench.startup(); @@ -191,7 +191,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts -@@ -97,6 +97,8 @@ export interface IDictationRuntimeProduc +@@ -117,6 +117,8 @@ export interface IDictationRuntimeProduc } export interface IProductConfiguration { @@ -256,7 +256,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -394,6 +394,7 @@ export class WebClientServer { +@@ -417,6 +417,7 @@ export class WebClientServer { } : undefined; const productConfiguration: Partial> = { diff --git a/patches/local-storage.diff b/patches/local-storage.diff index 31ce6c4ead26..e69931b8a6a9 100644 --- a/patches/local-storage.diff +++ b/patches/local-storage.diff @@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -420,6 +420,7 @@ export class WebClientServer { +@@ -443,6 +443,7 @@ export class WebClientServer { remoteAuthority, serverBasePath: basePath, webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', @@ -68,7 +68,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts +++ code-server/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts -@@ -150,8 +150,10 @@ export class WorkspaceService extends Di +@@ -155,8 +155,10 @@ export class WorkspaceService extends Di this.workspaceConfiguration = this._register(new WorkspaceConfiguration(configurationCache, fileService, uriIdentityService, logService)); this._register(this.workspaceConfiguration.onDidUpdateConfiguration(fromCache => { this.onWorkspaceConfigurationChanged(fromCache).then(() => { @@ -81,7 +81,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co }); })); -@@ -535,6 +537,10 @@ export class WorkspaceService extends Di +@@ -617,6 +619,10 @@ export class WorkspaceService extends Di private async createMultiFolderWorkspace(workspaceIdentifier: IWorkspaceIdentifier): Promise { await this.workspaceConfiguration.initialize({ id: workspaceIdentifier.id, configPath: workspaceIdentifier.configPath }, this.isWorkspaceTrusted); @@ -92,7 +92,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co const workspaceConfigPath = workspaceIdentifier.configPath; const workspaceFolders = toWorkspaceFolders(this.workspaceConfiguration.getFolders(), workspaceConfigPath, this.uriIdentityService.extUri); const workspaceId = workspaceIdentifier.id; -@@ -574,6 +580,10 @@ export class WorkspaceService extends Di +@@ -662,6 +668,10 @@ export class WorkspaceService extends Di previousFolders = this.workspace.folders; this.workspace.update(workspace); } else { diff --git a/patches/logout.diff b/patches/logout.diff index 6777c1578218..cfaf4c662809 100644 --- a/patches/logout.diff +++ b/patches/logout.diff @@ -8,7 +8,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts -@@ -100,6 +100,7 @@ export interface IProductConfiguration { +@@ -120,6 +120,7 @@ export interface IProductConfiguration { readonly codeServerVersion?: string readonly rootEndpoint?: string readonly updateEndpoint?: string @@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -34,6 +34,7 @@ export function getRedactedServerParsedA +@@ -32,6 +32,7 @@ export function getRedactedServerParsedA export const serverOptions: OptionDescriptions> = { /* ----- code-server ----- */ 'disable-update-check': { type: 'boolean' }, @@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -128,6 +129,7 @@ export const serverOptions: OptionDescri +@@ -127,6 +128,7 @@ export const serverOptions: OptionDescri export interface ServerParsedArgs { /* ----- code-server ----- */ 'disable-update-check'?: boolean; @@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -402,6 +402,7 @@ export class WebClientServer { +@@ -425,6 +425,7 @@ export class WebClientServer { codeServerVersion: this._productService.codeServerVersion, rootEndpoint: rootBase, updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined, diff --git a/patches/marketplace.diff b/patches/marketplace.diff index 6991967abe5c..40ac597f0830 100644 --- a/patches/marketplace.diff +++ b/patches/marketplace.diff @@ -41,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -387,7 +387,6 @@ export class WebClientServer { +@@ -410,7 +410,6 @@ export class WebClientServer { const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH); const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH); @@ -49,7 +49,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority }); -@@ -404,14 +403,7 @@ export class WebClientServer { +@@ -427,14 +426,7 @@ export class WebClientServer { rootEndpoint: rootBase, embedderIdentifier: 'server-distro', voiceWsUrl: this._productService.voiceWsUrl, diff --git a/patches/proposed-api.diff b/patches/proposed-api.diff index 3b2286b043e7..8a3bb9559502 100644 --- a/patches/proposed-api.diff +++ b/patches/proposed-api.diff @@ -25,7 +25,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts +++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts -@@ -31,7 +31,7 @@ export class ExtensionsProposedApi { +@@ -32,7 +32,7 @@ export class ExtensionsProposedApi { this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id))); diff --git a/patches/proxy-uri.diff b/patches/proxy-uri.diff index 67a14f6a9275..1e37caa648c7 100644 --- a/patches/proxy-uri.diff +++ b/patches/proxy-uri.diff @@ -36,7 +36,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts -@@ -101,6 +101,7 @@ export interface IProductConfiguration { +@@ -121,6 +121,7 @@ export interface IProductConfiguration { readonly rootEndpoint?: string readonly updateEndpoint?: string readonly logoutEndpoint?: string @@ -77,7 +77,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -403,6 +403,7 @@ export class WebClientServer { +@@ -426,6 +426,7 @@ export class WebClientServer { rootEndpoint: rootBase, updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined, logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined, @@ -89,7 +89,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalE =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts -@@ -292,7 +292,7 @@ export async function createTerminalEnvi +@@ -294,7 +294,7 @@ export async function createTerminalEnvi // Sanitize the environment, removing any undesirable VS Code and Electron environment // variables diff --git a/patches/remote-storage.diff b/patches/remote-storage.diff index 354b96065c0e..e96233f017b9 100644 --- a/patches/remote-storage.diff +++ b/patches/remote-storage.diff @@ -84,7 +84,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -66,6 +66,7 @@ export const serverOptions: OptionDescri +@@ -64,6 +64,7 @@ export const serverOptions: OptionDescri 'disable-experiments': OPTIONS['disable-experiments'], 'disable-workspace-trust': OPTIONS['disable-workspace-trust'], 'file-watcher-polling': { type: 'string', deprecates: ['fileWatcherPolling'] }, @@ -92,7 +92,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts 'log': OPTIONS['log'], 'logsPath': OPTIONS['logsPath'], 'force-disable-user-env': OPTIONS['force-disable-user-env'], -@@ -212,6 +213,7 @@ export interface ServerParsedArgs { +@@ -211,6 +212,7 @@ export interface ServerParsedArgs { 'logsPath'?: string; 'force-disable-user-env'?: boolean; @@ -104,7 +104,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts +++ code-server/lib/vscode/src/vs/server/node/serverServices.ts -@@ -106,6 +106,10 @@ import { McpManagementChannel } from '.. +@@ -110,6 +110,10 @@ import { McpManagementChannel } from '.. import { AllowedMcpServersService } from '../../platform/mcp/common/allowedMcpServersService.js'; import { IMcpGalleryManifestService } from '../../platform/mcp/common/mcpGalleryManifest.js'; import { McpGalleryManifestIPCService } from '../../platform/mcp/common/mcpGalleryManifestServiceIpc.js'; @@ -115,7 +115,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts import { SANDBOX_HELPER_CHANNEL_NAME, SandboxHelperChannel } from '../../platform/sandbox/common/sandboxHelperIpc.js'; import { SandboxHelperService } from '../../platform/sandbox/node/sandboxHelper.js'; -@@ -244,6 +248,21 @@ export async function setupServerService +@@ -248,6 +252,21 @@ export async function setupServerService services.set(IMcpGatewayService, new SyncDescriptor(McpGatewayService)); const instantiationService: IInstantiationService = new InstantiationService(services); @@ -137,7 +137,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts services.set(ILanguagePackService, instantiationService.createInstance(NativeLanguagePackService)); const ptyHostStarter = instantiationService.createInstance( -@@ -446,6 +465,7 @@ export async function setupServerService +@@ -420,6 +439,7 @@ export async function setupServerService const languagePackChannel = ProxyChannel.fromService(accessor.get(ILanguagePackService), disposables); socketServer.registerChannel('languagePacks', languagePackChannel); @@ -149,7 +149,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -451,7 +451,8 @@ export class WebClientServer { +@@ -474,7 +474,8 @@ export class WebClientServer { folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']), workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']), productConfiguration, @@ -187,7 +187,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts import { IStorageService } from '../../platform/storage/common/storage.js'; import { toLocalISOString } from '../../base/common/date.js'; import { isWorkspaceToOpen, isFolderToOpen } from '../../platform/window/common/window.js'; -@@ -488,7 +489,7 @@ export class BrowserMain extends Disposa +@@ -489,7 +490,7 @@ export class BrowserMain extends Disposa serviceCollection.set(IWorkbenchConfigurationService, service); return service; }), @@ -196,7 +196,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts serviceCollection.set(IStorageService, service); return service; }) -@@ -613,7 +614,21 @@ export class BrowserMain extends Disposa +@@ -614,7 +615,21 @@ export class BrowserMain extends Disposa })); } @@ -223,7 +223,7 @@ Index: code-server/lib/vscode/src/vs/sessions/browser/web.main.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/sessions/browser/web.main.ts +++ code-server/lib/vscode/src/vs/sessions/browser/web.main.ts -@@ -51,9 +51,9 @@ export class SessionsBrowserMain extends +@@ -52,9 +52,9 @@ export class SessionsBrowserMain extends _workspace: IAnyWorkspaceIdentifier, environmentService: IBrowserWorkbenchEnvironmentService, userDataProfileService: IUserDataProfileService, @@ -235,7 +235,7 @@ Index: code-server/lib/vscode/src/vs/sessions/browser/web.main.ts uriIdentityService: IUriIdentityService, policyService: IPolicyService, logService: ILogService, -@@ -94,7 +94,7 @@ export class SessionsBrowserMain extends +@@ -95,7 +95,7 @@ export class SessionsBrowserMain extends serviceCollection.set(IWorkbenchConfigurationService, configurationService); // Storage diff --git a/patches/series b/patches/series index 392eb015c77a..4b16a77eeceb 100644 --- a/patches/series +++ b/patches/series @@ -22,7 +22,6 @@ clipboard.diff display-language.diff trusted-domains.diff signature-verification.diff -copilot.diff app-name.diff remote-storage.diff remote-secret-storage.diff diff --git a/patches/service-worker.diff b/patches/service-worker.diff index c16835d54f63..80cf3f482b95 100644 --- a/patches/service-worker.diff +++ b/patches/service-worker.diff @@ -6,7 +6,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts -@@ -102,6 +102,10 @@ export interface IProductConfiguration { +@@ -122,6 +122,10 @@ export interface IProductConfiguration { readonly updateEndpoint?: string readonly logoutEndpoint?: string readonly proxyEndpointTemplate?: string @@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -404,6 +404,10 @@ export class WebClientServer { +@@ -427,6 +427,10 @@ export class WebClientServer { updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined, logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined, proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/', diff --git a/patches/sourcemaps.diff b/patches/sourcemaps.diff index 222609f46381..ef6974855ca8 100644 --- a/patches/sourcemaps.diff +++ b/patches/sourcemaps.diff @@ -6,7 +6,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.ts =================================================================== --- code-server.orig/lib/vscode/build/gulpfile.reh.ts +++ code-server/lib/vscode/build/gulpfile.reh.ts -@@ -254,10 +254,15 @@ function packageTask(type: string, platf +@@ -255,10 +255,15 @@ function packageTask(type: string, platf const destination = path.join(BUILD_ROOT, destinationFolderName); return () => { @@ -22,4 +22,4 @@ Index: code-server/lib/vscode/build/gulpfile.reh.ts + .pipe(jsFilterMain.restore); const workspaceExtensionPoints = ['debuggers', 'jsonValidation']; - const isUIExtension = (manifest: { extensionKind?: string; main?: string; contributes?: Record }) => { + const isUIExtension = (manifest: { extensionKind?: string | string[]; main?: string; contributes?: Record }) => { diff --git a/patches/telemetry.diff b/patches/telemetry.diff index fcbd196b7c03..a08dd31bf0e3 100644 --- a/patches/telemetry.diff +++ b/patches/telemetry.diff @@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts +++ code-server/lib/vscode/src/vs/server/node/serverServices.ts -@@ -68,6 +68,7 @@ import { IExtensionsScannerService } fro +@@ -69,6 +69,7 @@ import { IExtensionsScannerService } fro import { ExtensionsScannerService } from './extensionsScannerService.js'; import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js'; import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js'; @@ -20,18 +20,16 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts import { NullPolicyService } from '../../platform/policy/common/policy.js'; import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js'; import { LoggerService } from '../../platform/log/node/loggerService.js'; -@@ -184,11 +185,23 @@ export async function setupServerService +@@ -188,11 +189,21 @@ export async function setupServerService const requestService = new RequestService('remote', configurationService, environmentService, logService); services.set(IRequestService, requestService); + let isContainer = undefined; -+ try { -+ await fs.promises.stat('/run/.containerenv'); ++ if (await Promises.exists('/run/.containerenv')) { + isContainer = true; -+ } catch (error) { /* Does not exist, probably. */ } -+ if (!isContainer) { ++ } else { /* Does not exist, probably. */ + try { -+ const content = await fs.promises.readFile('/proc/self/cgroup', 'utf8') ++ const content = await Promises.readFile('/proc/self/cgroup', 'utf8') + isContainer = content.includes('docker'); + } catch (error) { /* Permission denied, probably. */ } + } @@ -126,7 +124,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -408,6 +408,8 @@ export class WebClientServer { +@@ -431,6 +431,8 @@ export class WebClientServer { scope: vscodeBase + '/', path: rootBase + '/_static/out/browser/serviceWorker.js', }, @@ -139,7 +137,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts -@@ -106,6 +106,7 @@ export interface IProductConfiguration { +@@ -126,6 +126,7 @@ export interface IProductConfiguration { readonly path: string; readonly scope: string; } diff --git a/patches/trusted-domains.diff b/patches/trusted-domains.diff index bec547aa74cc..6e03efc22bc0 100644 --- a/patches/trusted-domains.diff +++ b/patches/trusted-domains.diff @@ -4,7 +4,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -39,6 +39,7 @@ export const serverOptions: OptionDescri +@@ -37,6 +37,7 @@ export const serverOptions: OptionDescri 'disable-file-uploads': { type: 'boolean' }, 'disable-getting-started-override': { type: 'boolean' }, 'locale': { type: 'string' }, @@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -138,6 +139,7 @@ export interface ServerParsedArgs { +@@ -137,6 +138,7 @@ export interface ServerParsedArgs { 'disable-file-uploads'?: boolean; 'disable-getting-started-override'?: boolean, 'locale'?: string @@ -24,7 +24,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -399,6 +399,14 @@ export class WebClientServer { +@@ -422,6 +422,14 @@ export class WebClientServer { scopes: [['user:email'], ['repo']] } : undefined; @@ -39,7 +39,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts const productConfiguration: Partial> = { codeServerVersion: this._productService.codeServerVersion, rootEndpoint: rootBase, -@@ -414,6 +422,7 @@ export class WebClientServer { +@@ -437,6 +445,7 @@ export class WebClientServer { embedderIdentifier: 'server-distro', voiceWsUrl: this._productService.voiceWsUrl, extensionsGallery: this._productService.extensionsGallery, diff --git a/patches/update-check.diff b/patches/update-check.diff index 091f787e81c3..e7a4ace10abe 100644 --- a/patches/update-check.diff +++ b/patches/update-check.diff @@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts -@@ -99,6 +99,7 @@ export interface IDictationRuntimeProduc +@@ -119,6 +119,7 @@ export interface IDictationRuntimeProduc export interface IProductConfiguration { readonly codeServerVersion?: string readonly rootEndpoint?: string @@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts readonly version: string; readonly date?: string; -@@ -148,6 +149,7 @@ export interface IProductConfiguration { +@@ -168,6 +169,7 @@ export interface IProductConfiguration { }; readonly extensionsGallery?: { @@ -113,7 +113,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -401,6 +401,7 @@ export class WebClientServer { +@@ -424,6 +424,7 @@ export class WebClientServer { const productConfiguration: Partial> = { codeServerVersion: this._productService.codeServerVersion, rootEndpoint: rootBase, @@ -125,7 +125,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts -@@ -32,6 +32,8 @@ export function getRedactedServerParsedA +@@ -30,6 +30,8 @@ export function getRedactedServerParsedA } export const serverOptions: OptionDescriptions> = { @@ -134,7 +134,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -124,6 +126,8 @@ export const serverOptions: OptionDescri +@@ -123,6 +125,8 @@ export const serverOptions: OptionDescri }; export interface ServerParsedArgs { diff --git a/patches/webview.diff b/patches/webview.diff index 74aaaf182a43..2ccba16951ee 100644 --- a/patches/webview.diff +++ b/patches/webview.diff @@ -41,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts -@@ -416,6 +416,7 @@ export class WebClientServer { +@@ -439,6 +439,7 @@ export class WebClientServer { const workbenchWebConfiguration = { remoteAuthority, serverBasePath: basePath,