0

How to run active file by integrated terminal?

I set hotkey for workbench.action.terminal.runActiveFile

It works but not correct, cause launch path as command:

C:\cwd>c:\cwd\app.js but i need C:\cwd>node app.js

try catch
  • 1
  • 1
  • I think you are going to need the extension "code runner" https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner where you can tell it to run javascript files with node. – Mark Aug 25 '18 at 15:21
  • Thanks, i already use code runner, and it`s luggy. – try catch Aug 25 '18 at 18:25
  • There is a way to do it with a macro if you are interested. – Mark Aug 25 '18 at 19:24
  • Now see my answer at https://stackoverflow.com/questions/55082394/run-files-in-terminal-from-vs-code/55082505#55082505 - no need for a macro anymore to run the current file with node.js. – Mark Mar 09 '19 at 22:22

0 Answers0