Search code examples
jsonwindowsvisual-studio-codepathsettings

How can I add multiple values to a PATH environment variable definition in my integrated terminal configurations in VS Code?


I am trying to work with manim (a math animation library), and it requires the path to ffmpeg, which is stored in a different location then my other libraries. How can I extend my settings.json in VS Code to include multiple paths?

My current settings.json file:

{
    "terminal.integrated.env.windows": {
        "PATH": "C:\\Users\\Computer_User\\AppData\\Local\\Programs\\Python\\Python311\\Scripts"
    }
}

Solution

  • I'm pretty sure that for Windows, you just do something like this:

    "terminal.integrated.env.windows": {
        "PATH": "foo;bar;baz"
    }
    

    Where foo, bar, and baz are paths.

    The semicolon is Windows' separator character for entries in PATH environment variables. For UNIX systems, use colons instead.

    You can add ${env:PATH} to the list if you want to include the PATH that is in the environment of the VS Code instance running the integrated terminal.

    If you want an OS-independent variable to use, see VSCode variable for OS-independent list separator in environment variables.