Sublime Forum

[SOLVED] current folder wrong when using unc path in windows

#1

If you open a file via UNC path in Windows, ST2 inaccurately reports the current working directory as C:\Windows
This causes problems with plugins like Git when you try to use git on a network share, it believes all files reside in C:\windows and will not correctly look at the git repository in the directory.

0 Likes

#2

I tested this under ST3, same behavior.

0 Likes

#3

What you do mean by current folder here?

Sublime Text resets its current directory to the executable path on startup, and never changes it again.

0 Likes

#4

[quote=“jps”]What you do mean by current folder here?

I just tried this in ST2 and got a different message that helps me figure out what is going on.
Before it just said C:\Windows isn’t a repository, now I am getting:

‘\NAS01\git\Corona\Libraries\Table’
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
fatal: pathspec ‘main.lua’ did not match any files

So that problem isn’t Sublime, it is Git plugin using CMD starting folder (which currently doesn’t support UNC).

Sorry, not Sublime related.
Thanks for the follow up.

I wanted to avoid it, but the only way I see around this is to map a drive to the share.[/quote]

0 Likes

#5

I have the same behavior while runing a python script is this topic really closed ?

0 Likes