Open bluenote10 opened 2 years ago
Can confirm the same behavior on windows.
And Mac #136258
For me doesn't even need to be in multi root workspace. Just doing ALT + TAB to anything and coming back to vscode and everything gets collapsed. Its very disruptive.
Is there any setting regard this behavior?
Related on Stack Overflow: VS Code collapses folder in Explorer View when it gets focus for multi-root workspaces
Occurs on linux when building VSCode from source.
Happens on both multi-root workspace and regular workspace.
Setting "skipRefreshExplorerOnWindowFocus": true,
in settings.json
doesn't help.
Version: 1.85.0 Commit: Unknown Date: Unknown Electron: 25.9.6 ElectronBuildId: undefined Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Linux x64 6.6.3-arch1-1
We have logic to refresh the explorer whenever the window gets focus:
I do not see an option to disable this though.
Is there some reliable steps how to reproduce this? In my basic testing I was not able to. Maybe also play around with explorer related settings that could have an impact 🙏
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Small bash script to create the example project
```sh #!/bin/bash mkdir -p some_multi_language_project cd some_multi_language_project mkdir -p python mkdir -p rust/src cd rust cat > Cargo.toml << EOF [package] name = "example" version = "0.1.0" EOF cat > src/lib.rs << EOF pub fn hello_world() { println!("Hello world"); } EOF cd .. cat > example.code-workspace << EOF { "folders": [ { "path": "." }, { "path": "rust" } ], "settings": {} } EOF ```Or for direct download: some_multi_language_project.zip
Run
code --disable-extensions some_multi_language_project/example.code-workspace
Work on a file. Notice that the source tree is unfolded in the Explorer view, and the currently active file is properly selected.
Press
<ALT>
+<TAB>
to switch to a different application, and<ALT>
+<TAB>
again to go back to VSCodeNotice that the source tree in the Explorer view has fully collapsed. The currently active file is not selected any more.
Note the problem doesn't seem to be fully deterministic. In the tiny example workspace it happens with perhaps ~50% probability. In a bigger real world workspace, it happens with more like ~95%.
From a practical point of view this issue is more disconcerting than I have expected initially, because every time it happens I feel like I have lost my orientation due to the fully collapsed source tree.