Skip to content

${workspaceRoot} is empty when no file is open #28620

Closed
@szabolcsdombi

Description

@szabolcsdombi
  • VSCode Version: 1.13.0
  • OS Version: Windows 10 64bit

Steps to Reproduce:

  1. Open a folder with vscode
  2. Create .vscode/tasks.json
  3. Add a task:
{
    "taskName": "7. Check",
    "command": "start",
    "args": ["cmd /k \"${workspaceRoot}\\check.bat\""],
    "showOutput": "never",
    "isShellCommand": true
}
  1. Close all the files
  2. Run the task: 7. Check
'\check.bat' is not recognized as an internal or external command,
operable program or batch file.

If you skip 4. (or you have at least one open file) the file is executed properly.

The problem:

If there is no open file in the editor the ${workspaceRoot} is equal to ""

Metadata

Metadata

Assignees

Labels

*caused-by-extensionIssue identified to be caused by an extension

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions