Tyriar / vscode-shell-launcher

VS Code extension that enables easy launching of multiple shell configurations in the terminal
https://marketplace.visualstudio.com/items?itemName=Tyriar.shell-launcher
MIT License
49 stars 9 forks source link

WSL Bash not showing #27

Open stefanstranger opened 5 years ago

stefanstranger commented 5 years ago

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

Tyriar commented 5 years ago

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.

stefanstranger commented 5 years ago

I tried wsl, but that failed too.

Output while debugging.

wslerror

Stefan

Tyriar commented 5 years ago

@stefanstranger what version of Windows 10 are you on?

Heer-Boaz commented 5 years ago

@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

Tyriar commented 5 years ago

@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 commented 5 years ago

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

jabalv commented 4 years ago

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.