Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Workspace to envNew to Visual Studio Code? Get it now.
Workspace to env

Workspace to env

Jan Gebhart

|
43 installs
| (0) | Free
Set an environment variable in the VSCode terminal to the currently opened workspace or folder, enabling its use in Git commands and user scripts.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Workspace to env

Set an environment variable in the VSCode terminal to the currently opened workspace or folder, enabling its use in Git commands and user scripts.

Features

This extension sets an environment variable to the currently opened workspace. If no workspace is open, it sets the variable to the currently opened folder.

Usage

Example .gitconfig

[core]
    editor = code -r --wait $FILE $WORKSPACE
[diff]
    tool = vscode
[difftool "vscode"]
    cmd = "code -r --wait --diff $LOCAL $REMOTE $WORKSPACE"

Extension Settings

workspace2env.envVarName: "The name of the environment variable to set. Default: WORKSPACE"

Known Issues

Release Notes

0.0.1

Initial release.

0.0.2

Now it set eviromet variable directly in each terminal.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft