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 1 year ago • 3 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 solve it right now. Your script may have the "#!/bin/bash" at the first line which causes bash interpreter is fixed. So, the solution is just deleting the line. Then, your customed command can take effect instantly.

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