Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: is there a way to set environment variables within debugger settings? #65

Open
s6mike opened this issue Jul 11, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@s6mike
Copy link

s6mike commented Jul 11, 2022

I have a very long PATH and CPATH, which I'm copying and pasting into each launch.json configuration (of which I have quite a number).

Is there a way to set the PATH and CPATH once somewhere, perhaps in the extension settings? As far as I can see there is only 1 setting available.

That seems to be the way other debuggers handle the matter, though possibly there is another way to set environment variables for launch.json which I don't know about? (I'm still learning the ropes with VSCode).

(FYI, the reason the paths are so long is because I'm linking to code in my project plus dependencies installed in a virtual environment.)

Thanks! Great extension, just given you a good review :)

@tomblind
Copy link
Owner

There isn't another way to do this right now, but it seems like a pretty straight-forward feature to add.

@tomblind tomblind added the enhancement New feature or request label Jul 12, 2022
@s6mike
Copy link
Author

s6mike commented Jul 12, 2022

Thanks!

For now, I've learnt that you can pull arbitrary VSCode settings into launch.json (or tasks.json) like this:

"LUA_PATH": "${config:lua.debug.settings.path}",

In this case, using a setting I'd already configured for a different extension I'm no longer using.

I thought I'd be able to use {env:X} and neatly solve my problem but while this worked on tasks.json, couldn't get it to work in launch.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants