question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add several basic predefined variables for use in launch.json - e.g. ${uid}, ${gid}, ${user}, ${home}

See original GitHub issue

Please expose several basic predefined variables for use in launch.json like ${uid}, ${gid}, ${user}, ${home} (and potentially in settings.json too, as per https://github.com/microsoft/vscode/issues/2809).

Example use cases:

  1. Extremely useful for multi-user environments to avoid port or path conflicts. (See YAML below)
  2. Generally similar use cases to https://github.com/microsoft/vscode/issues/2809 where one needs to specify paths to SDKs, GOPATHs and alike.
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "perl",
      "request": "launch",
      "name": "Perl-Debug",
      "console": "remote",
      "port": "${uid}",  // <---- HERE!
      "root": "${workspaceFolder}/.vscode/root",
      "program": "${workspaceFolder}/${relativeFile}",
      "stopOnEntry": false,
      "reloadModules": false,
      "sessions": "watch",
    }
  ]
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
weinandcommented, Jun 23, 2022

@ssbarnea did you try to use an environment variable that is defined outside of VS Code? You can easily access that as `${env:variable}´.

0reactions
weinandcommented, Jun 23, 2022

@ssbarnea I was actually suggesting to introduce a new env variable and assign it to different values on the different platforms.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Variables reference - Visual Studio Code
json files using ${variableName} syntax. Predefined variables. The following predefined variables are supported: ${userHome} - the path of the user's home ...
Read more >
Provide a homeDir system variable for use in launch.json
Set paths that start at the Home Directory (eg: %USERPROFILE% on Windows, $HOME / ~ on Linux). It would be nice to have...
Read more >
Dev Container metadata reference
Environment and pre-defined variables may be referenced in the values. ... to use a different user than the one for the container, see...
Read more >
Dockerize your projects in Visual Studio Code
The application in this example uses three different services. Important are the environment variables which need to be configured here for ...
Read more >
podman-build
Add an image label (e.g. label=value) to the image metadata. Can be used multiple times. Users can set a special LABEL io.containers.capabilities=CAP1,CAP2,CAP3 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found