vscode icon indicating copy to clipboard operation
vscode copied to clipboard

WSL terminals cannot be started anymore on Windows 10

Open robUx4 opened this issue 6 months ago • 1 comments

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.101.0
  • OS Version: Windows 10 Pro 19045.5917

Steps to Reproduce:

  1. Open any WSL terminal
  2. Get an error about bash.exe not recognizing the -d option
/bin/bash: -d: invalid option
Usage:  /bin/bash [GNU long option] [option] ...
        /bin/bash [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --debugger
        --dump-po-strings
        --dump-strings
        --help
        --init-file
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --pretty-print
        --rcfile
        --restricted
        --verbose
        --version
Shell options:
        -ilrsD or -c command or -O shopt_option         (invocation only)
        -abefhkmnptuvxBCEHPT or -o option

The bogus commit is 2d35c6fb74cfb4f63b00f46baa18948afea5365f. It's forcing bash.exe instead of wsl.exe on Windows 10 which doesn't know how to run WSL.

robUx4 avatar Jun 13 '25 06:06 robUx4

For now I had to add my own versions of the same thing:

"terminal.integrated.profiles.windows": {
    "Debian": {
        "path": [
            "${env:windir}\\System32\\wsl.exe"
        ],
        "args": ["-d", "Debian"],
        "icon": "terminal-debian"
    },
    "Ubuntu": {
        "path": [
            "${env:windir}\\System32\\wsl.exe"
        ],
        "args": ["-d", "Ubuntu"],
        "icon": "terminal-ubuntu"
    },
  ...
}

robUx4 avatar Jun 13 '25 06:06 robUx4