1

I am using Visual Studio Code 1.52.0 in Windows against a WSL filesystem. The filesystem is marked case-sensitive in WSL:

mikebaz@PSTower-2020-06:~/code/test$ getfattr -n system.wsl_case_sensitive .
# file: .
system.wsl_case_sensitive="1"

and correctly shows as case-sensitive in File Explorer (so there isn't a basic Windows issue here). There are two folders with the same name, but different cases:

two folders, "Folder1" and "folder1", in File Explorer

However, in Visual Studio Code, these folders are collapsed into one folder:

Visual Studio Code EXPLORER view showing "folder1"

This also impacts the source code status for the Git repo in the folder - Code seems confused. Although there is a file and it's properly tracked and committed:

mikebaz@PSTower-2020-06:~/code/test/Folder1$ git status -u
On branch master
nothing to commit, working tree clean

the Code view insists that there's an untracked file:

Git status in Code showing the green "U" for "Untracked" under "Changes"

How can I tell Visual Studio Code to stop trying to "help" me by collapsing the two folders and being confused as a result?

MikeBaz - MSFT
  • 2,938
  • 4
  • 28
  • 57

1 Answers1

1

I was able to reproduce your issue by:

  • Creating ~/temp/Folder1 and ~/temp/folder1
  • Launching VSCode
  • File -> Open Folder
  • Opening the folder \\WSL$\<distroname>\home\<username>\temp

And yes, I see the unwarranted (and unwanted) folder deduplication you are seeing.

However, do you have the Remote - WSL extension or the Remote Development extension pack installed? With Remote - WSL, I can open the folder through the remote connection and see both Folder1 and folder1.

In WSL:

  • cd ~/temp
  • code .

And everything is displaying correctly.

Note: This seems to be a known issue (although perhaps not quite in the way that you are encountering it).

As for the problems it seems to be causing with the git repo, you might want to try disabling the VSCode git integration as described in this thread.

Side note, one of my first tests was to try toggling the Compact Folders setting on (it is on by default, but I had disabled it), but that didn't have any impact on this particular issue.

NotTheDr01ds
  • 15,620
  • 5
  • 44
  • 70
  • Yes, this does work with your workaround of launching Code from WSL side, thank you. And the integrated Git tools "just work" with this workaround as well. I agree that it seems like it's related to the NFS issue that you link to. – MikeBaz - MSFT Dec 21 '20 at 14:07
  • 1
    The linked issue is fixed in CPPTools as of 1.13.0 ( https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.0 ) although that still leaves the wider issue there. The comments on that issue seem to suggest that the official answer is the same of "remoting to WSL". (see also https://github.com/microsoft/vscode-cpptools/issues/1994#issuecomment-749268560 ) – MikeBaz - MSFT Sep 12 '22 at 18:30