vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

[Bug] -Windows shellscript executorMap not being honored.

Open shotah opened this issue 3 years ago • 5 comments

  • VS Code Version: 1.72.2
  • OS Version: Windows 11
  • Code Runner Version: v0.11.8

Describe the bug Trying to change how shellscripts run to be able to quickly use code runner. I've tried setting different options in settings but nothing changes.

  "code-runner.executorMap": {
    "shellscript": "cd $dir && sh $fileName",
  }

To Reproduce Steps to reproduce the behavior:

  1. Set anything in executor map for shellscript
  2. Try to run a bash file
  3. Get the original message and settings are not honored.

Actual behavior Always get the EXACT same message, not matter how I change shellscript

[Running] /bin/bash "c:\workspace\test"
The system cannot find the path specified.

Expected behavior To be able to set variables and enable shellscripts to work with code runner.

shotah avatar Oct 20 '22 17:10 shotah

I had the same question. But I solved it just now. Your script may have the #!/bin/bash at the first line, which causes the bash interpreter to be fixed. So, just remove this line. Then, your custom command can take effect instantly.


By the way, it is controlled by this code-runner option.

fvydjt avatar Mar 11 '23 15:03 fvydjt

I just encountered the same problem and I removed "#!/bin/bash" then the code-runner will work like a charm. Thanks!

zhuoqun-chen avatar Jul 04 '23 06:07 zhuoqun-chen

removed the line. still error below

(base) PS E:\code\open\ahks> bash  "e:\code\open\ahks\publish.sh"
/bin/bash: e:codeopenahkspublish.sh: No such file or directory

and found code run config for bash is:

   "shellscript": "bash ",

change to :

   "shellscript": "bash  $fileName",

it works

fanlushuai avatar Dec 22 '23 17:12 fanlushuai

I had the same question. But I solved it just now. Your script may have the #!/bin/bash at the first line, which causes the bash interpreter to be fixed. So, just remove this line. Then, your custom command can take effect instantly.

By the way, it is controlled by this code-runner option.

Thank you! It works!

zjh-de-github avatar Jul 30 '24 07:07 zjh-de-github