DavidA
DavidA

Reputation: 2359

How to configure VS Code on Windows to run a task in WSL?

I am running VS Code 1.6 on Windows and have configured the integrated terminal to be bash:

"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe",

I want to build my C++ project using make running in WSL. So I defined a task:

{
    "version": "0.1.0",
    "command": "make",
    "isShellCommand": true,
    "args": [""],
    "showOutput": "always"
}

How can I configure that task to run in WSL?

How can I set the directory in which make should run? (not the root directory of the folder opened in Code, but a subfolder of it).

Upvotes: 4

Views: 2011

Answers (1)

Rich Turner
Rich Turner

Reputation: 10984

Try this (replacing as appropriate:

{ "version": "0.1.0", "command": "c:\\Windows\\sysnative\\bash.exe", "isShellCommand": true, "args": ["-c 'cd /mnt/c/<path>; make'"], "showOutput": "always" }

Upvotes: 0

Related Questions