-
Notifications
You must be signed in to change notification settings - Fork 315
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
Explorer and source control extension not updating git status in WSL 2 #2310
Comments
Hi, is there any update on this issue? I'm still experiencing this issue on the latest version of VSCode (1.44.1). |
Can you
|
I assuming you mean the Developer: Set Log Level command, correct? There's also a Git: Set Log Level command. If you mean the developer one, the highest log level i can set is Trace. If I set it to trace, I don't see any logs from File Watcher as I make changes to files. |
Yes, Any other messages about the file watcher? There should be at least one when it's starting. |
This seems to be the only message I'm getting from File Watcher: [File Watcher (chokidar)] Start watching with chockidar: /mnt/d/dev/[redacted], excludes: /.git/objects/,/.git/subtree-cache/,/.hg/store/,/node_modules/*/,/home/tyler/.vscode-server/extensions/,/*.asar, usePolling: false I don't get any error messages at all and nothing related to handles as far as I can see. |
The Remote Server Log indicates the file watcher is working and has detected all changes (I'm in the middle of a rebase). But the Source Control tab on the explorer doesn't seem to render the changes. Also on WSL2 |
@trenslow Hm, the setup message looks all fine. The git excludes are fine. Can you open VSCode on a folder with only a few files in it and see if there's the same problem? If it's a folder with a lot of files in it, you can try this:
|
It's both the Source Control viewer and the VS Code Explorer viewer as well. And it's not just when new files are created in the open folder, it's also when a git-tracked file is modified, deleted, etc. (when one would expect an M, D, etc. to show up next to the file name). I opened a folder with only a few files (not sure what a few files means exactly, but this one has around 10 small yaml files) and it had the same behavior. I also increased the max user watches and restarted VSCode and got the same result as before. Thanks so much for your help so far. I wish I could provide more information, but up to now I haven't noticed anything else that would be of interest. I even tried restarting wsl process with no result. |
I'm afraid I also don't know what's going on. Anything special about the location of the folder? |
The D: drive is a physical drive on my machine. I just tried in /home/tyler and now it works as it should. Also for completeness, I tried with a folder on my C: drive and it works as well. Somehow the watcher doesn't like the D: drive. edit: I also noticed that the small clock symbol on the Source Control viewer icon doesn't appear when the folder is opened from the D: drive, but it does when opened in my Linux home folder as well as the C: drive. Not sure if that helps. edit 2: After more playing around, I realized that if you open the folder from the Linux terminal using the command 'code .', the git tracking works, regardless of which drive/file system the folder resides on. It's only when using the remote button in the bottom left corner of VSCode, or the command palette to open a folder in WSL, where the Source Control viewer and File Explorer fail. |
WSL2 still has multiple open issues about missing file events on the mounted drives, e.g. microsoft/WSL#4169, microsoft/WSL#4739 Edit 2 is interesting. Can you have a look what the log says about the file watcher, when things work? Like in #2310 (comment) |
I have the same problem as @MarcelloTheArcane with the repo on the home folder I can't see git changes in the Source Control Viewer |
Yep same problem. I need to refresh the explorer each time I make a change. |
It started working for me when I closed the wsl connection and started it again. Don't know what was the exact issue. |
Edit 2 helped me.... Edit: Initially, I tried "code {foldername}" which does not solve the issue.... |
The git tracking does not function properly though (when new file is created from file explorer and not from terminal, the git fails to identify it as new file and so i have to refresh the git controller in vs code) |
Hello,
For one of my projects, I develop by opening the folder in WSL (Ubuntu) using the remote WSL extension. I recently installed WSL 2 on my system and everything with a small exception works out of the box.
When I change a file in the folder, which is also a git repo, the explorer doesn't update to reflect the change in the repository. If I close the remote connection and reopen it again, it then shows the change. This doesn't effect the editor markup where you can see line changes, deletions, etc., but the git status changes are also not reflected in the VS Code Source Control tab.
I thought this may have to do with the git extension installed, but I uninstalled it and ran into the same issue, leading me to believe this is a VS Code bug.
Steps to Reproduce:
Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No
Is anyone else experiencing this issue in WSL 2?
The text was updated successfully, but these errors were encountered: