Repository navigation
Support OS-specific command overrides (windows, osx, linux) in tasks.json
#66970
ansi-sudo
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What are you proposing?
Adding support for OS-specific configuration blocks (
"windows","osx"/"macos","linux") inside project task definitions.Why does this matter?
When developers switch between multiple computers running different operating systems (such as a Windows desktop at home and a MacBook on the go) or collaborate across mixed OS teams, projects often require different shell commands, path separators, or flags per OS. (This might be just me)
Currently:
.vscode/tasks.json, it ignores"windows","osx", and"linux"override blocks and always runs the root"command"(or fails to list the task at all if no root"command"is defined)..zed/tasks.jsondoes not support OS-specific overrides either (unlikesettings.json, which already supports platform blocks).Are there any examples or context?
For example, when working on a Java/Gradle project across both a macOS laptop and a Windows PC, a single task in
.vscode/tasks.jsoncan define OS-specific commands (chmod +x gradlew && ./gradlew buildon macOS and.\gradlew buildon Windows):{ "version": "2.0.0", "tasks": [ { "label": "Build", "type": "shell", "command": "./gradlew build", "osx": { "command": "chmod +x gradlew && ./gradlew build" }, "windows": { "command": ".\\gradlew build" } } ] }All reactions