microsoft / microsoft/vscode-remote-release

Files replaced with symlinks under WSL are not being detected as changed by VScode run from WSL

Open
#3,725 2 comments 0 reactions 1 assignee View on GitHub

@aeschli is already working on this.

Since Sep 24, 2020.

bug file-watcher plan-review wsl
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

  • VSCode Version: 1.49.1
  • OS Version: Windows_NT x64 10.0.19041

Steps to Reproduce:

# steps run from WSL terminal  launched in an empty directory
git init
mkdir subdir
ls > basefile.txt
git add --all
git commit -a -m initial-commit
cp basefile.txt subdir
code .
# Should now have both VScode and the terminal screen open tied to the same directory
## Visual code reports one file modified as expected
git status
## shows the untracked file in `subdir`
git add --all
git commit -a -m 2nd-commit
## the previous two commands run successfully
git status
## shows a clean working tree
## but VScode still shows the outstanding original change
## clicking refresh in VScode shows a clean working tree
ls > 2ndfile.txt
git status
##  shows new untracked file
## VScode shows the new file, but does not list it as new
## if you hit refresh in VScode the file shows up as a new file for git
git add --all
git commit -a -m 3rd-commit
git status
## shows a clean working tree
## but VScode still shows the outstanding original change
## clicking refresh in VScode shows a clean working tree
cd subdir/
ln -s ../2ndfile.txt .
ls -la
git status
## shows the untracked file in `subdir`
## But in VScode the file does not show up in the Explorer
ls > 3rdfile.txt
git status
## now shows two untracked file in `subdir`
## if you hit refresh in VScode both files show up in Explorer and as new files for git
git add --all
git commit -a -m 4th-commit
git status
## shows a clean working tree
## but VScode still shows the outstanding original change
## clicking refresh in VScode shows a clean working tree
rm *.txt
git status
## shows 3 files in `subdir` tagged for deletion
## if you hit refresh in VScode the same changes show up there
ln -s ../*.txt .
git status
## Shows as expected:
###        deleted:    3rdfile.txt
###        typechange: basefile.txt
## Hitting refresh in VScode only shows the deletion of '/3rdfile.txt' and is missing the type change on 'basefile.txt'
## if you commit the change from vscode it shows a clean working directory
git status
## But this still shows
###        typechange: basefile.txt

The bug is the fact that a symlink is not detected as a change, while a new symlink does show up as a change.

It would also be nice if the VSCode explorer and git integration detected the changes to the underlying file structure more dynamically. VSCode appears to do a much better job of this when using the Native Windows version on top of the native Windows file system. But when doing cross-platform development where the code base uses symlinks and/or illegal Windows characters in file and directory names (ie: ':' character) this forces you to use the WSL filesystem and VSCode in WSL.

Does this issue occur when all extensions are disabled?: Yes/No - Did not test

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.