diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 814c9f767f61b..bd434c851903e 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as os from 'os'; import * as path from 'vs/base/common/path'; import * as objects from 'vs/base/common/objects'; import * as nls from 'vs/nls'; @@ -799,6 +800,11 @@ export class CodeWindow extends Disposable implements ICodeWindow { // Parts splash windowConfiguration.partsSplashPath = path.join(this.environmentService.userDataPath, 'rapid_render.json'); + // OS Info + windowConfiguration.os = { + release: os.release() + }; + // Config (combination of process.argv and window configuration) const environment = parseArgs(process.argv, OPTIONS); const config = Object.assign(environment, windowConfiguration) as unknown as { [key: string]: unknown }; diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 6fa6c3216258b..74b87a5c52911 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -230,6 +230,10 @@ export interface IWindowConfiguration { filesToDiff?: IPath[]; } +export interface IOSConfiguration { + release: string; +} + export interface INativeWindowConfiguration extends IWindowConfiguration, NativeParsedArgs { mainPid: number; @@ -256,6 +260,8 @@ export interface INativeWindowConfiguration extends IWindowConfiguration, Native userEnv: IProcessEnvironment; filesToWait?: IPathsToWaitFor; + + os: IOSConfiguration; } /** diff --git a/src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts b/src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts index 0613b2b72878c..15a790b6630aa 100644 --- a/src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts +++ b/src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts @@ -89,6 +89,7 @@ export class SimpleNativeWorkbenchEnvironmentService implements INativeWorkbench sessionId = this.configuration.sessionId; machineId = this.configuration.machineId; remoteAuthority = this.configuration.remoteAuthority; + os = { release: 'unknown' }; options?: IWorkbenchConstructionOptions | undefined; logExtensionHostCommunication?: boolean | undefined; diff --git a/src/vs/workbench/services/environment/electron-browser/environmentService.ts b/src/vs/workbench/services/environment/electron-browser/environmentService.ts index 576f2cc555da4..e124b2508d687 100644 --- a/src/vs/workbench/services/environment/electron-browser/environmentService.ts +++ b/src/vs/workbench/services/environment/electron-browser/environmentService.ts @@ -10,6 +10,7 @@ import { URI } from 'vs/base/common/uri'; import { Schemas } from 'vs/base/common/network'; import { join } from 'vs/base/common/path'; import { IProductService } from 'vs/platform/product/common/productService'; +import { IOSConfiguration } from 'vs/platform/windows/common/windows'; export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService implements INativeWorkbenchEnvironmentService { @@ -82,6 +83,10 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService return undefined; } + get os(): IOSConfiguration { + return this.configuration.os; + } + constructor( readonly configuration: INativeWorkbenchConfiguration, private readonly productService: IProductService diff --git a/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts b/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts index e534169ba0ba8..ef5be8fcc5ad5 100644 --- a/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts +++ b/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IWorkbenchConfiguration, IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; -import { INativeWindowConfiguration } from 'vs/platform/windows/common/windows'; +import { INativeWindowConfiguration, IOSConfiguration } from 'vs/platform/windows/common/windows'; import { INativeEnvironmentService } from 'vs/platform/environment/common/environment'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; @@ -27,6 +27,8 @@ export interface INativeWorkbenchEnvironmentService extends IWorkbenchEnvironmen readonly log?: string; + readonly os: IOSConfiguration; + // TODO@ben this is a bit ugly updateBackupPath(newPath: string | undefined): void; diff --git a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts index 26dd802bba92c..5bb6f74c670c1 100644 --- a/src/vs/workbench/test/electron-browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/electron-browser/workbenchTestServices.ts @@ -40,7 +40,7 @@ import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/ur import { MouseInputEvent } from 'vs/base/parts/sandbox/common/electronTypes'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IOSProperties, IOSStatistics } from 'vs/platform/native/common/native'; -import { homedir } from 'os'; +import { homedir, release } from 'os'; export const TestWorkbenchConfiguration: INativeWorkbenchConfiguration = { windowId: 0, @@ -54,6 +54,7 @@ export const TestWorkbenchConfiguration: INativeWorkbenchConfiguration = { execPath: process.execPath, perfEntries: [], colorScheme: { dark: true, highContrast: false }, + os: { release: release() }, ...parseArgs(process.argv, OPTIONS) };