Vscode-code-runner: [Bug][VS Code 1.56] Not detect shell on Windows correctly

Created on 8 May 2021  路  9Comments  路  Source: formulahendry/vscode-code-runner


  • VS Code Version: 1.56.0
  • OS Version: Windows_NT x64 10.0 19042
  • Code Runner Version: v0.11.3

Describe the bug
When we assign "Command Prompt" to "terminal.integrated.defaultProfile.windows" parameter, "&&" in code-runner.executorMap will be translated into "; if ($?) {

To Reproduce
Steps to reproduce the behavior:

  1. Configure "terminal.integrated.defaultProfile.windows": "Command Prompt" in settings.json
  2. Include "&&" in any of language "code-runner.executorMap".
  3. Run the code.

Actual behavior
Translate "&& " into "; if ($?) { }"

Expected behavior
Interpret "&&" as is.

Screenshots
If applicable, add screenshots to help explain your problem.

bug upstream

Most helpful comment

I also found this problem. However, I found a temporary solution to this problem:

add "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe" in settings.json to make CodeRunner not translate & into ; if ($?) { }.

However, this will cause a warning in settings.json. I guess this may be because CodeRunner doesn't realize that vscode has abandoned the "terminal.integrated.shell.windows" setting.

image

All 9 comments

Probably it's a visual studio code side issue, but anyway I post it at here now.

I also found this problem. However, I found a temporary solution to this problem:

add "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe" in settings.json to make CodeRunner not translate & into ; if ($?) { }.

However, this will cause a warning in settings.json. I guess this may be because CodeRunner doesn't realize that vscode has abandoned the "terminal.integrated.shell.windows" setting.

image

@officer @blackpancake This issue has been fixed. Please install the latest version and have a try.

image

still have issue with bash....

image

still have issue with bash....

In CMD, this issue has been fixed.
image

@jack20951948 You could use below setting:

"code-runner.terminalRoot": "/"

@jack20951948 You could use below setting:

"code-runner.terminalRoot": "/"

image
yeah...I've already had this setting...

seems in git bash still have some issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

N2ITN picture N2ITN  路  5Comments

seiferthan picture seiferthan  路  4Comments

manikantag picture manikantag  路  4Comments

Kelo007 picture Kelo007  路  3Comments

spacesuitdiver picture spacesuitdiver  路  3Comments