vscode-shell-launcher icon indicating copy to clipboard operation
vscode-shell-launcher copied to clipboard

WSL Bash not showing

Open stefanstranger opened this issue 6 years ago • 7 comments

I configured the settings for the shell launcher as follows:

"shellLauncher.shells.windows": [
        {
            "shell": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
            "label": "PowerShell"
        },
        {
            "shell": "C:\\Program Files\\PowerShell\\6.0.0-beta.8\\powershell.exe",
            "label": "PowerShell Core"
        },
        {
            "shell": "C:\\Windows\\System32\\cmd.exe",
            "label": "cmd"
        },
        {
            "shell": "C:\\Windows\\System32\\bash.exe",
            "label": "WSL Bash"
        }
    ]

When launching the Shell Launcher task it only shows the PowerShell, PowerShell Core and cmd shells.

Why does the WSL Bash option does not show up?

/Stefan

stefanstranger avatar Aug 01 '18 14:08 stefanstranger

My guess is that this access check is failing:

https://github.com/Tyriar/vscode-shell-launcher/blob/27d07379f9e5fdca212fe40ac804f6d7432892a8/src/extension.ts#L66

Maybe wsl.exe will work? This might depend on the version of Windows 10 you're running as I believe in older versions bash.exe was some special executable that I couldn't find on disk.

Tyriar avatar Aug 03 '18 15:08 Tyriar

I tried wsl, but that failed too.

Output while debugging.

wslerror

Stefan

stefanstranger avatar Aug 08 '18 13:08 stefanstranger

@stefanstranger what version of Windows 10 are you on?

Tyriar avatar Aug 15 '18 15:08 Tyriar

@Tyriar: I had the same issue as stefanstranger. I was able to solve it by changing the search-path from "C:\\Windows\\system32\\wsl.exe" to "C:\\Windows\\Sysnative\\wsl.exe". Note that it points to wsl.exe, but the same problem/solution is valid for bash.exe.

Note that I now run VSCode with the User installation.

My W10 (x64) Version: 10.0.16299 Build 16299

Heer-Boaz avatar Aug 16 '18 11:08 Heer-Boaz

@Heer-Boaz you're probably using the 32-bit version of VS Code on your 64-bit machine if sysnative works, you should switch to the 64-bit version. Merging this into https://github.com/Tyriar/vscode-shell-launcher/issues/28

Tyriar avatar Aug 21 '18 17:08 Tyriar

Actually I think @stefanstranger probably is seeing a different issue since cmd worked.

Tyriar avatar Aug 21 '18 17:08 Tyriar

Actually I think @stefanstranger probably is seeing a different issue since cmd worked.

Because 32bit vscode is using System32 cmd or SysWOW64 folder( contains 32bit dlls) on 64bit OS. I assume WSL bash is only 64bit application, so it's not there. If "Sysnative" virtual folder will be specified in path then redirection to real System32 folder of 64bit dlls will happen.

jabalv avatar Nov 09 '19 17:11 jabalv