Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/services/environment/electron-browser/shellEnvironmentService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
7
import { IProcessEnvironment } from '../../../../base/common/platform.js';
8
import { process } from '../../../../base/parts/sandbox/electron-browser/globals.js';
9
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
10
11
export const IShellEnvironmentService = createDecorator<IShellEnvironmentService>('shellEnvironmentService');
12
13
export interface IShellEnvironmentService {
14
15
readonly _serviceBrand: undefined;
16
17
getShellEnv(): Promise<IProcessEnvironment>;
18
}
19
20
export class ShellEnvironmentService implements IShellEnvironmentService {
21
22
declare readonly _serviceBrand: undefined;
23
24
getShellEnv(): Promise<IProcessEnvironment> {
25
return process.shellEnv();
26
}
27
}
28
29
registerSingleton(IShellEnvironmentService, ShellEnvironmentService, InstantiationType.Delayed);
30
31