Skip to content

Commit b7a8821

Browse files
authored
Merge branch 'main' into fix/idle-timeout-seconds-space-form
2 parents 512aed1 + cd0f21d commit b7a8821

9 files changed

Lines changed: 99 additions & 13 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ Code v99.99.999
2727
- `--idle-timeout-seconds` was only validated when passed as `--idle-timeout-seconds=<value>`;
2828
values of 60 or less passed as `--idle-timeout-seconds <value>` were silently accepted.
2929

30+
## [4.138.0](https://github.com/coder/code-server/releases/tag/v4.138.0) - 2026-09-19
31+
32+
Code v1.138.0
33+
34+
### Changed
35+
36+
- Update to Code 1.138.0
37+
38+
### Fixed
39+
40+
- Preserve the original path, query parameters, and fragment when rewriting
41+
localhost URLs through the port proxy. If `VSCODE_PROXY_URI` has any query
42+
parameters or fragments, those will be lost.
43+
3044
## [4.137.0](https://github.com/coder/code-server/releases/tag/v4.137.0) - 2026-09-11
3145

3246
Code v1.137.0

‎ci/helm-chart/Chart.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 3.52.0
18+
version: 3.53.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: 4.137.0
23+
appVersion: 4.138.0

‎ci/helm-chart/values.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replicaCount: 1
66

77
image:
88
repository: codercom/code-server
9-
tag: '4.137.0'
9+
tag: '4.138.0'
1010
pullPolicy: Always
1111

1212
# Specifies one or more secrets to be used when pulling images from a

‎lib/vscode‎

Submodule vscode updated 2114 files

‎patches/external-file-actions.diff‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
128128
@@ -6,10 +6,10 @@
129129
import { Disposable } from '../../base/common/lifecycle.js';
130130
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
131-
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
131+
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext, IsChromeOSContext } from '../../platform/contextkey/common/contextkeys.js';
132132
-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';
133133
+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';
134134
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
@@ -147,7 +147,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
147147
@IProductService private readonly productService: IProductService,
148148
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
149149
@IEditorService private readonly editorService: IEditorService,
150-
@@ -205,6 +205,10 @@ export class WorkbenchContextKeysHandler
150+
@@ -206,6 +206,10 @@ export class WorkbenchContextKeysHandler
151151
this.auxiliaryBarMaximizedContext = AuxiliaryBarMaximizedContext.bindTo(this.contextKeyService);
152152
this.auxiliaryBarMaximizedContext.set(this.layoutService.isAuxiliaryBarMaximized());
153153

‎patches/getting-started.diff‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
216216
@@ -6,7 +6,7 @@
217217
import { Disposable } from '../../base/common/lifecycle.js';
218218
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
219-
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
219+
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext, IsChromeOSContext } from '../../platform/contextkey/common/contextkeys.js';
220220
-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';
221221
+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';
222222
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
223223
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
224224
import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js';
225-
@@ -208,6 +208,7 @@ export class WorkbenchContextKeysHandler
225+
@@ -209,6 +209,7 @@ export class WorkbenchContextKeysHandler
226226
// code-server
227227
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
228228
IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true)

‎patches/proposed-api.diff‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
1010
===================================================================
1111
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
1212
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
13-
@@ -324,6 +324,10 @@ function extensionDescriptionArrayToMap(
13+
@@ -321,6 +321,10 @@ function extensionDescriptionArrayToMap(
1414
}
1515

1616
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {

‎patches/proxy-uri.diff‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ This has e2e tests.
1313
For the `asExternalUri` changes, you'll need to test manually by:
1414
1. running code-server with the test extension
1515
2. Command Palette > code-server: asExternalUri test
16-
3. input a url like http://localhost:3000
17-
4. it should show a notification and show output as <code-server>/proxy/3000
16+
3. input a url like http://localhost:3000/my/path?token=abc#section
17+
4. it should show a notification and show output as
18+
<code-server>/proxy/3000/my/path?token%3Dabc#section
1819

1920
Do the same thing but set `VSCODE_PROXY_URI: "https://{{port}}-main-workspace-name-user-name.coder.com"`
2021
and the output should replace `{{port}}` with port used in input url.
2122

23+
The rewritten URI must preserve the original path, query, and fragment (see
24+
#7668). Append the original path to the proxy path using URI components so
25+
encoded characters are not decoded or encoded twice. This also works with
26+
proxy templates that do not have a trailing slash.
27+
2228
This also enables the forwared ports view panel by default.
2329

2430
Lastly, it adds a tunnelProvider so that ports are forwarded using code-server's
@@ -104,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
104110
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
105111
import { create } from '../../../workbench/workbench.web.main.internal.js';
106112

107-
@@ -612,6 +613,39 @@ class WorkspaceProvider implements IWork
113+
@@ -612,6 +613,44 @@ class WorkspaceProvider implements IWork
108114
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
109115
workspaceProvider: WorkspaceProvider.create(config),
110116
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
@@ -116,7 +122,12 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
116122
+ const renderedTemplate = config.productConfiguration.proxyEndpointTemplate
117123
+ .replace('{{port}}', localhostMatch.port.toString())
118124
+ .replace('{{host}}', window.location.host)
119-
+ resolvedUri = URI.parse(new URL(renderedTemplate, window.location.href).toString())
125+
+ const proxyUri = URI.parse(new URL(renderedTemplate, window.location.href).toString())
126+
+ resolvedUri = proxyUri.with({
127+
+ path: proxyUri.path.replace(/\/$/, '') + uri.path,
128+
+ query: uri.query,
129+
+ fragment: uri.fragment,
130+
+ })
120131
+ } else {
121132
+ throw new Error(`Failed to resolve external URI: ${uri.toString()}. Could not determine base url because productConfiguration missing.`)
122133
+ }

‎test/e2e/extensions.test.ts‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,56 @@ function runTestExtensionTests() {
1515
const normalizedAddress = address.replace(/\/+$/, "")
1616
await expect(codeServerPage.page.getByText(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)).toBeVisible()
1717
})
18+
19+
runExternalUriTests()
20+
}
21+
22+
function runExternalUriTests(proxyEndpointTemplate?: string) {
23+
const cases = [
24+
{
25+
name: "path",
26+
input: "http://127.0.0.1:1234/my/path",
27+
suffix: "/my/path",
28+
},
29+
{
30+
name: "query and fragment",
31+
input: "http://localhost:1234/my/path?token=abc&mode=preview#section",
32+
suffix: "/my/path?token%3Dabc%26mode%3Dpreview#section",
33+
},
34+
{
35+
name: "encoded components",
36+
input: "http://0.0.0.0:1234/my%20path/%23file?token=a%20b#my%20section",
37+
suffix: "/my%20path/%23file?token%3Da%20b#my%20section",
38+
},
39+
{
40+
name: "root path",
41+
input: "http://127.0.0.1:1234/",
42+
suffix: "/",
43+
},
44+
]
45+
46+
for (const { name, input, suffix } of cases) {
47+
test(`asExternalUri should preserve ${name}`, async ({ codeServerPage }) => {
48+
const address = await getMaybeProxiedCodeServer(codeServerPage)
49+
const normalizedAddress = address.replace(/\/+$/, "")
50+
const proxyBase = proxyEndpointTemplate
51+
? new URL(proxyEndpointTemplate.replace("{{port}}", "1234"), `${normalizedAddress}/`).toString()
52+
: `${normalizedAddress}/proxy/1234/`
53+
54+
await codeServerPage.waitForTestExtensionLoaded()
55+
await codeServerPage.executeCommandViaMenus("code-server: asExternalUri test")
56+
57+
const inputBox = codeServerPage.page.locator(".quick-input-widget input")
58+
await inputBox.fill(input)
59+
await inputBox.press("Enter")
60+
61+
// The test extension displays URI.toString(), which also encodes query delimiters.
62+
const output = `${proxyBase.replace(/\/$/, "")}${suffix}`
63+
await expect(
64+
codeServerPage.page.getByText(`Info: input: ${input} output: ${output}`, { exact: true }),
65+
).toBeVisible()
66+
})
67+
}
1868
}
1969

2070
const flags = ["--disable-workspace-trust", "--extensions-dir", path.join(__dirname, "./extensions")]
@@ -23,6 +73,17 @@ describe("Extensions", flags, {}, () => {
2373
runTestExtensionTests()
2474
})
2575

76+
for (const proxyEndpointTemplate of ["./proxy/{{port}}", "https://{{port}}-workspace.example.com"]) {
77+
describe(
78+
`Extensions with VSCODE_PROXY_URI=${proxyEndpointTemplate}`,
79+
flags,
80+
{ VSCODE_PROXY_URI: proxyEndpointTemplate },
81+
() => {
82+
runExternalUriTests(proxyEndpointTemplate)
83+
},
84+
)
85+
}
86+
2687
if (process.env.USE_PROXY !== "1") {
2788
describe("Extensions with --cert", [...flags, "--cert"], {}, () => {
2889
runTestExtensionTests()

0 commit comments

Comments
 (0)