env

object env(source)

Namespace describing the environment the editor runs in.

Online Documentation

Properties

Link copied to clipboard

The hosted location of the application On desktop this is 'desktop' In the web this is the specified embedder i.e. 'github.dev', 'codespaces', or 'web' if the embedder does not provide that information

Link copied to clipboard

The application name of the editor, like 'VS Code'.

Link copied to clipboard

The application root folder from which the editor is running.

Link copied to clipboard

The system clipboard.

Link copied to clipboard

Indicates that this is a fresh install of the application. true if within the first day of installation otherwise false.

Link copied to clipboard

Indicates whether the users has telemetry enabled. Can be observed to determine if the extension should send telemetry.

Link copied to clipboard

Represents the preferred user-language, like de-CH, fr, or en-US.

Link copied to clipboard

The current log level of the editor.

Link copied to clipboard

A unique identifier for the computer.

Link copied to clipboard

An Event which fires when the log level of the editor changes.

Link copied to clipboard

An Event which fires when the default shell changes. This fires with the new shell path.

Link copied to clipboard

An Event which fires when the user enabled or disables telemetry. true if the user has enabled telemetry or false if the user has disabled telemetry.

Link copied to clipboard

The name of a remote. Defined by extensions, popular samples are wsl for the Windows Subsystem for Linux or ssh-remote for remotes using a secure shell.

Link copied to clipboard

A unique identifier for the current session. Changes each time the editor is started.

Link copied to clipboard

The detected default shell for the extension host, this is overridden by the terminal.integrated.defaultProfile setting for the extension host's platform. Note that in environments that do not support a shell the value is the empty string.

Link copied to clipboard

The UI kind property indicates from which UI extensions are accessed from. For example, extensions could be accessed from a desktop application or a web browser.

Link copied to clipboard

The custom uri scheme the editor registers to in the operating system.

Functions

Link copied to clipboard

Resolves a uri to a form that is accessible externally.

Link copied to clipboard

Creates a new telemetry logger.

Link copied to clipboard

Opens a link externally using the default application. Depending on the used scheme this can be: