Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

${userHome} in a task command creates bad paths #209218

Open
paulober opened this issue Mar 31, 2024 · 2 comments
Open

${userHome} in a task command creates bad paths #209218

paulober opened this issue Mar 31, 2024 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues

Comments

@paulober
Copy link

paulober commented Mar 31, 2024

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.87.2
  • OS Version: Windows_NT x64 10.0.22631

Steps to Reproduce:

  1. Create a tasks.json with a task command that looks like this:
"command": "${userHome}/myfolder/my.exe",
"type": "process"
  1. The variable works if you set it to be type shell and the default shell is pwsh and not git bash. But if set to type process it results in a path like:
/c:/Users/myuser/myfolder/my.exe

With an error like: "The terminal process could not be started: The path to the executable shell file "\c:\Users\myuser\myfolder\my.exe" does not exist.

NOTE: The task does work if I use ${env:USERPROFILE} instead of ${userHome}, as env:USERPROFILE results in a path like C:\Users\myuser/myfolder/my.exe to be executed.

@ymotongpoo
Copy link

I faced a similar issue where ${userHome} is recognized as ${workspaceFolder}. I'm using VSCode Macros and tried to set the following config:

    "vscodemacros.macroFilePath": "${userHome}${/}personal${/}vscodemacros${/}macros.js",

However I got the following error message:

'/Users/yoshifumi/personal/foo_workspace/$$personal$vscodemacros$macros.js' not found.```

${userHome} should be recognized as /Users/yoshifumi but it was treated as /Users/yoshifumi/personal/foo_workspace/ which is the directory name that I was opening in VS Code.

My environment info is as the following:

Version: 1.88.1 (Universal)
Commit: e170252f762678dec6ca2cc69aba1570769a5d39
Date: 2024-04-10T17:42:52.765Z (6 days ago)
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.4.0

@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug and removed confirmation-pending labels Apr 17, 2024
@Slion
Copy link

Slion commented Oct 9, 2024

I face a similar issue on Windows where userHome does not always resolve to env:USERPROFILE.
See: raspberrypi/pico-vscode#100
Though I guess I should open another ticket really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues
Projects
None yet
Development

No branches or pull requests

4 participants