|
| 1 | +Apply --app-name to VS Code web page titles |
| 2 | + |
| 3 | +VS Code's `${appName}` title variable comes from `productService.nameLong` in the |
| 4 | +web client. code-server already injects per-request product configuration into |
| 5 | +VS Code's web bootstrap, so set `nameShort`/`nameLong` from the existing |
| 6 | +`--app-name` CLI arg there. |
| 7 | + |
| 8 | +This keeps the patch minimal and makes browser tab titles honor `--app-name` |
| 9 | +without changing unrelated product metadata. |
| 10 | + |
| 11 | +Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts |
| 12 | +=================================================================== |
| 13 | +--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts |
| 14 | ++++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts |
| 15 | +@@ -24,6 +24,7 @@ export const serverOptions: OptionDescri |
| 16 | + 'disable-getting-started-override': { type: 'boolean' }, |
| 17 | + 'locale': { type: 'string' }, |
| 18 | + 'link-protection-trusted-domains': { type: 'string[]' }, |
| 19 | ++ 'app-name': { type: 'string' }, |
| 20 | + |
| 21 | + /* ----- server setup ----- */ |
| 22 | + |
| 23 | +@@ -120,6 +121,7 @@ export interface ServerParsedArgs { |
| 24 | + 'disable-getting-started-override'?: boolean, |
| 25 | + 'locale'?: string |
| 26 | + 'link-protection-trusted-domains'?: string[], |
| 27 | ++ 'app-name'?: string, |
| 28 | + |
| 29 | + /* ----- server setup ----- */ |
| 30 | + |
| 31 | +Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts |
| 32 | +=================================================================== |
| 33 | +--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts |
| 34 | ++++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts |
| 35 | +@@ -366,8 +366,11 @@ export class WebClientServer { |
| 36 | + linkProtectionTrustedDomains.push(...this._productService.linkProtectionTrustedDomains); |
| 37 | + } |
| 38 | + |
| 39 | ++ const appName = this._environmentService.args['app-name']; |
| 40 | + const productConfiguration: Partial<Mutable<IProductConfiguration>> = { |
| 41 | + codeServerVersion: this._productService.codeServerVersion, |
| 42 | ++ nameShort: appName, |
| 43 | ++ nameLong: appName, |
| 44 | + rootEndpoint: rootBase, |
| 45 | + updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined, |
| 46 | + logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined, |
0 commit comments