Skip to content

Need Env Variables for DataDir and ExtensionDir #49306

Closed
@daviduuang

Description

@daviduuang

Currently, we can only get a few env variables when refer to the mannual here.
So other extensions may access the path of extension and data dir in their code like this:

let settingsPath = path.join(process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE, 'commandbar.json');

And we can run vscode with command-line parameters here.

If we specify the following options(for example, we can make it portable), we may change the extension and data dir settings.

--extensions-dir <dir> Set the root path for extensions.
--user-data-dir <dir> Specifies the directory that user data is kept in, useful when running as root.

But other extensions cann't realize the changes, so it may fails. This issue may be solved when env variables of extension-dir and data-dir exposed.


VSCode v1.23.0 x64(on Win10)

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)apifeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions