Microsoft Windows [Version 10.0.18362.175]
Windows Terminal version (if applicable): latest from the store
"startingDirectory" : "%SYSTEMDRIVE%",Starting dir is the system drive, e.g. C
Starting dir is %SYSTEMDRIVE%system32
https://i.imgur.com/hyT2wi7.png
%systemroot% works fine, didn't check other env vars
This is just a quirk of how paths on Windows work! Here's something neat. %SYSTEMDRIVE% expands to C:, but...
C: is a "relative" path, it's just relative to "which folder is currently active on the C drive"... which is a behavior that dates back to DOS 2.0.
As an example, if I set my "active directory" on my _E_ drive to E:\src, I can do this:
dir E:openconsole
and I'll get the response:
Volume in drive E is Thorium
Volume Serial Number is 1AF0-C31B
Directory of e:\src\openconsole <-- here!
Anyway, the way around this is to use %SYSTEMDRIVE%\ (which you'll need to properly escape for JSON) which makes it an absolute path anchored at your system drive.
_We, of course, cannot change any of this. It's old Windows and DOS arcana that people love to rely on. It lets you do things like COPY A:bigfile C:bigfile2 without specifying directories, which can get long and annoying._
Most helpful comment
This is just a quirk of how paths on Windows work! Here's something neat.
%SYSTEMDRIVE%expands toC:, but...C:is a "relative" path, it's just relative to "which folder is currently active on the C drive"... which is a behavior that dates back to DOS 2.0.As an example, if I set my "active directory" on my _E_ drive to
E:\src, I can do this:and I'll get the response:
Anyway, the way around this is to use
%SYSTEMDRIVE%\(which you'll need to properly escape for JSON) which makes it an absolute path anchored at your system drive._We, of course, cannot change any of this. It's old Windows and DOS arcana that people love to rely on. It lets you do things like
COPY A:bigfile C:bigfile2without specifying directories, which can get long and annoying._