Example:
version: "3"
tasks:
default:
cmds:
- echo "{{.PWD}}"
Running from terminal:
$ task
task: [default] echo "/Volumes/Projects/Code_Projects/LinuxEnv"
/Volumes/Projects/Code_Projects/LinuxEnv
Running from sidebar:
task: [default] echo "/"
/
task: completed with code 0
The most logical behavior would be to set the PWD to the root of the opened folder.
$ task --version
Task version: 3.39.2 ()
- Operating System: macOS 15.1
Update: I observe the same behavior with USER_WORKING_DIR.
Update 2: Never mind, I added USER_WORKING_DIR in the wrong spot, it does work! I wonder why PWD doesn't, then again I don't see it documented?
Update 3: Interesting, I just tried it with {{.SHELL}} and in it works in both cases. So I guess that in my previous test, PWD came from the environment, maybe it needs to be explicitly set when running from the sidebar?
I am inclined to just close this issue as being user error, but I feel like it's just weird enough (confused me a for a bit) that it might be worth it to set the PWD variable in the VSCode extension?
Example:
Running from terminal:
Running from sidebar:
The most logical behavior would be to set the PWD to the root of the opened folder.
Update: I observe the same behavior withUSER_WORKING_DIR.Update 2: Never mind, I added
USER_WORKING_DIRin the wrong spot, it does work! I wonder whyPWDdoesn't, then againI don't see it documented?Update 3: Interesting, I just tried it with
{{.SHELL}}and in it works in both cases. So I guess that in my previous test,PWDcame from the environment, maybe it needs to be explicitly set when running from the sidebar?I am inclined to just close this issue as being user error, but I feel like it's just weird enough (confused me a for a bit) that it might be worth it to set the PWD variable in the VSCode extension?