You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Explorer does not refresh when previously removed root is coming back #134144
macOS. I have a VS Code window open to the vscode repo but it does NOT have focus. I instead have focus on another window of VS Code (or another app... same behavior)
Here's the script I'm running outside of VS Code:
All it does is renames the vscode folder that I have open in VS Code and renames it back 100 times.
I noticed that the removal of the vscode folder gets reflected in the VS Code instance with the vscode repo (where it gives you the ! that says this folder doesnt exist)
However, when the rename gets changed back to vscode thus "recreating" the vscode folder, nothing is reflected in the VS Code instance with the vscode repo.
However, once I focus the VS Code instance with the vscode repo then the contents are refreshed and it shows up and everything is fine.
Yeah I noticed this as well and wonder if this is an issue in the explorer itself because doing the same (mv folderNameA folderNameB) is nicely reflected in the explorer for children of the root.
We must be having some handling of change events for folders, but probably not for the root itself? I think if the root changes we should do a refresh of the tree, but probably only in this case where we had a deleted root before because we do not really want the entire tree to refresh in other cases for performance reasons.
changed the title [-]Re-adding folder doesn't get reflected in VS Code until focus[/-][+]Explorer does not refresh when previously removed root is coming back[/+]on Sep 30, 2021
🤖 How to verify: the video for this fix is in this comment, with related fixes. It walks through the steps in real VS Code Insiders, checking each result in the app.
Verification: ordinary root passes; symlinked root still fails
Tested VS Code Insiders 1.143.0, commit 341e0fa9346520e7a6a09803a80c5ecd3027f3cb, on macOS 26.7.1 / Apple Silicon. Confirmed this build contains #341323.
Ordinary workspace root: passed
Ran three external rename-away/restore cycles, keeping the root missing for 10 seconds and restored for 10 seconds each time. The test window remained unfocused throughout, with no manual refresh or collapse/expand actions.
Renaming the root away removed its contents and displayed the missing-root ! decoration.
Restoring the root automatically cleared the decoration and restored its contents in 5.47–5.52 seconds.
A fresh marker file created during each missing-root interval appeared after restoration, confirming a real refresh rather than stale contents.
Symlinked single-folder workspace root: still fails
Also tested the symlink-target case mentioned above, using a directory symlink as the workspace root:
Open the symlinked root and confirm its original file is visible.
Move focus to another application.
Externally rename the symlink target away; leave the symlink itself unchanged.
Create a fresh marker file inside the renamed target, then rename the target back to its original path.
Observe Explorer without refocusing or manually refreshing it.
Observed: Explorer becomes empty when the target is renamed away, without the expected missing-root ! decoration. After restoring the target, Explorer remains empty for at least 30 seconds, with neither the original file nor the new marker visible. This background restoration failure reproduced in two independent runs. In an additional diagnostic, intentional native refocus succeeded, but Explorer still remained empty for another 10 seconds.
Focus was checked using document.hasFocus() plus window-focus event monitoring. These runs used a native Electron launch and a CDP connection with Playwright default focus emulation disabled; no unexpected focus events occurred during the background checks.
Result: 35 passing, including the root-restoration and focus-related tests.
Conclusion: the ordinary-root fix verifies, but I would not mark the entire issue verified because the symlinked-root case remains broken.
Scope: three ordinary-root cycles, not the original 100-cycle stress loop. Linux, Windows, and a pre-fix product comparison were not tested. Screenshots/video were captured locally but are not attached to this comment.
Activity
TylerLeonhardt commentedon Sep 29, 2021
This same behavior happens when you rename the target of a symbolic link and then rename it back.
bpasero commentedon Sep 30, 2021
Yeah I noticed this as well and wonder if this is an issue in the explorer itself because doing the same (
mv folderNameA folderNameB) is nicely reflected in the explorer for children of the root.We must be having some handling of change events for folders, but probably not for the root itself? I think if the root changes we should do a refresh of the tree, but probably only in this case where we had a deleted root before because we do not really want the entire tree to refresh in other cases for performance reasons.
[-]Re-adding folder doesn't get reflected in VS Code until focus[/-][+]Explorer does not refresh when previously removed root is coming back[/+]federicobrancasi commentedon Oct 18, 2026
🤖 How to verify: the video for this fix is in this comment, with related fixes. It walks through the steps in real VS Code Insiders, checking each result in the app.
mrleemurray commentedon Oct 19, 2026
Verification: ordinary root passes; symlinked root still fails
Tested VS Code Insiders 1.143.0, commit
341e0fa9346520e7a6a09803a80c5ecd3027f3cb, on macOS 26.7.1 / Apple Silicon. Confirmed this build contains #341323.Ordinary workspace root: passed
Ran three external rename-away/restore cycles, keeping the root missing for 10 seconds and restored for 10 seconds each time. The test window remained unfocused throughout, with no manual refresh or collapse/expand actions.
!decoration.Symlinked single-folder workspace root: still fails
Also tested the symlink-target case mentioned above, using a directory symlink as the workspace root:
Observed: Explorer becomes empty when the target is renamed away, without the expected missing-root
!decoration. After restoring the target, Explorer remains empty for at least 30 seconds, with neither the original file nor the new marker visible. This background restoration failure reproduced in two independent runs. In an additional diagnostic, intentional native refocus succeeded, but Explorer still remained empty for another 10 seconds.Focus was checked using
document.hasFocus()plus window-focus event monitoring. These runs used a native Electron launch and a CDP connection with Playwright default focus emulation disabled; no unexpected focus events occurred during the background checks.Automated regression coverage
./scripts/test.sh --run src/vs/workbench/contrib/files/test/browser/explorerService.test.ts --grep 'Files - ExplorerService' --reporter dotResult: 35 passing, including the root-restoration and focus-related tests.
Conclusion: the ordinary-root fix verifies, but I would not mark the entire issue verified because the symlinked-root case remains broken.
Scope: three ordinary-root cycles, not the original 100-cycle stress loop. Linux, Windows, and a pre-fix product comparison were not tested. Screenshots/video were captured locally but are not attached to this comment.