vscode-bash-debug
vscode-bash-debug copied to clipboard
Error: Reached to unreachable code while validating enviroment
How to reproduce:
- Install Bash Debug
- Try Debugging using Bash-Debug
Output:
I get this error:
Executables
Bash Debug: 0.3.5
Details
Configurations in launch.json
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (type in script name)",
"cwd": "${workspaceFolder}",
"program": "${command:AskForScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (select script from list of sh files)",
"cwd": "${workspaceFolder}",
"program": "${command:SelectScriptName}",
"args": []
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (hardcoded script name)",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/path/to/script.sh",
"args": []
},
settings.json
{
"python.pythonPath": "C:\\ProgramData\\Anaconda3\\python.exe",
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
}
Cannot reproduce. Is WSL installed?
I am having the same issue and I have installed WSL.
I am using: -Version: 0.3.6 -Simplest Config.
I get the same error after selecting the Start Debug button.
I have the same problem. Simplest Config. version 0.3.6. WSL is installed
I may have a fix/workaround for this. I am not sure why this works but when I tried just running "bash" by itself I got the message: "Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Microsoft Store: https://aka.ms/wslstore"
Looking further I found articles suggesting to run lxrun /install
. After doing that and executing bash
I found myself at the bash command prompt.
Now visual studio code bash debug works as expected. I hope this helps.
Just encountered this as well, my first time trying this extension with WSL.
Thing is that unlike what @zpittmansf described, bash
does work for me, so it seems no special commands are required.
However, the problem still exists, and I can't even find any logs to attach ☹️
Just installed Bash Debug for the first time and created the debug launch.json as specified, and I run into this in a basic Windows 64bit (non-WSL) environment.
Any tips?
I had the same problem after installing the bash_debug extension. When I googled for "/bin/ash: bash: not found", I first found this: WSL2: wsl.exe shell not picking up $PATH #4167 That page recommended to search here instead for a solution.
After finding this page, I decided to try what was recommended on the WSL issue page. I checked that my default WSL distribution was "Alpine". I changed it to "Ubuntu". That solved the problem!
[ After switching to Ubuntu, at first I got another error: "Error: BUG: timeout while validating environment.". But stopping the debugger and restarting, that error went away. ]