Skip to content

Extra semicolon in path enviroment variables #740

Closed

Description

@DanielHubik

Hi,
this extension adds to the environment variables inside vscode extra ';' at the end of the system
%PATH% !!! This causes double semicolon in the env variable !!!

'<some paths here>;;c:\Users\<name>\.vscode\extensions\ms-python.debugpy-2025.8.0-win32-x64\bundled\scripts'

You can test it via disabling the plugin and print it vscode env variables.

Here is vscode task to simplify testing:

        {
            "label": "Set Environment Variables",
            "type": "shell",
            "command": "cmd.exe /c set > %TEMP%\\vscode_env.txt",
            "problemMatcher": [],
            "presentation": {
                "panel": "shared",
                "reveal": "always",
                "focus": false,
                "showReuseMessage": true,
                "clear": false,
                "echo": true,
            }
        }

This error caused me GNU MAKE (4.2.1) not to work and hangs for 30minutes. If anyone have same issue, upgrade to newer GNU Make, it works fine with GNU Make 4.3 Built for x86_64-pc-msys.

Fix it !

Activity

  1. eleanorjboyd commented on Jun 30, 2025

    @eleanorjboyd
    Contributor

    Here's the code for that append:

    const noConfigScriptsDir = path.join(extPath, 'bundled', 'scripts', 'noConfigScripts');
    const pathSeparator = process.platform === 'win32' ? ';' : ':';
    collection.append('PATH', `${pathSeparator}${noConfigScriptsDir}`);
    . Does your path already include a ; at the end of it?

  2. DanielHubik commented on Jul 4, 2025

    @DanielHubik
    Author

    This is interesting, I did a research on few PCs and a small group had ending without the semicolon. I couldn't find correlation (win11/win10, apps, anything...). Would it be worth it to update the code to check for ';'?

  3. eleanorjboyd commented on Jul 7, 2025

    @eleanorjboyd
    Contributor

    To clarify your path, at this point, ends with a semicolon before the addition is made?

  4. DanielHubik commented on Jul 9, 2025

    @DanielHubik
    Author

    Just to clarify that my previous post. That meant some of the paths on some of the PCs ends with semicolon. Yes my path also ends with semicolon.

  5. eleanorjboyd commented on Jul 9, 2025

    @eleanorjboyd
    Contributor

    The change then that needs to be made is checking to existing PATH variable, if it has a semicolon don't add another when you append. See code marker:

    const noConfigScriptsDir = path.join(extPath, 'bundled', 'scripts', 'noConfigScripts');
    const pathSeparator = process.platform === 'win32' ? ';' : ':';
    collection.append('PATH', `${pathSeparator}${noConfigScriptsDir}`);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

triage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions