Overview
Thevscode.env namespace provides access to environment information about the editor and the system.
Properties
appName
The application name of the editor.appRoot
The application root folder from which the editor is running.appHost
The hosted location of the application.'desktop'. In the web this is the embedder (e.g., 'github.dev', 'codespaces', or 'web').
language
The preferred user language.machineId
A unique identifier for the computer.sessionId
A unique identifier for the current session. Changes each time the editor is started.clipboard
The system clipboard.uriScheme
The custom URI scheme the editor registers to in the operating system.isTelemetryEnabled
Indicates whether the user has telemetry enabled.isNewAppInstall
Indicates whether this is a fresh install (true if within the first day of installation).
Methods
openExternal
Opens a URI externally using the default application.asExternalUri
Resolves a URI as if it was being opened externally.Events
onDidChangeTelemetryEnabled
Fires when the user enables or disables telemetry.Common Use Cases
Check Running Environment
Localization
Clipboard Integration
Related Resources
Window API
Learn about window-level operations