how can I run the Windows Bash from Visual Studio code as a run task?
Here are some of my many attempts at tasks.json
to do this.
{
"version": "0.1.0",
"command": "cmd",
"isShellCommand": true,
"args": [ "RunShellScript.bat" ],
"showOutput": "always"
}
RunShellScript.bat has only this line: bash myShellScript.sh
. Which if you just open cmd from start, and type that line, it will execute. It also runs perfectly if you just double click the file as well. However, when launched from VSCode, this output just hangs until I terminate it.
Attempt number 2:
{
"version": "0.1.0",
"command": "cmd",
"isShellCommand": true,
"args": [ "bash myShellScript.sh" ],
"showOutput": "always"
}
This also hangs, just like above.
Attempt number 3:
{
"version": "0.1.0",
"command": "C:/Windows/System32/bash",
"isShellCommand": false,
"args": [ "myShellScript.sh" ],
"showOutput": "always"
}
This gives me:
Failed to launch external program C:/Windows/System32/bash myShellScript.sh
spawn C:/Windows/System32/bash ENOENT
Ive also experimented with setting the "isShellCommand"
variable to true and false in some of these cases, but to no avail.
Does anyone know how to do this?
C:\Windows\sysnative\bash.exe
. – Eddaeddana