Skip to content
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

ALT + TAB causes Explorer tree view to fully collapse in multi root workspace #139462

Open
bluenote10 opened this issue Dec 19, 2021 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues workbench-multiroot Multi-root (multiple folders) issues
Milestone

Comments

@bluenote10
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.63.2
  • OS Version: Ubuntu 18.04

Steps to Reproduce:

  1. Create a multi-root workspace with nested workspace folders. I'm using a structure like this:
some_multi_language_project  <-- Workspace folder
├── example.code-workspace
├── python
└── rust                     <-- Workspace folder
    ├── Cargo.toml
    └── src
        └── lib.rs
Small bash script to create the example project
#!/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

  1. Run code --disable-extensions some_multi_language_project/example.code-workspace

  2. Work on a file. Notice that the source tree is unfolded in the Explorer view, and the currently active file is properly selected.

  3. Press <ALT> + <TAB> to switch to a different application, and <ALT> + <TAB> again to go back to VSCode

  4. Notice that the source tree in the Explorer view has fully collapsed. The currently active file is not selected any more.

Peek 2021-12-19 10-46

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.

@YunHsiao
Copy link

Can confirm the same behavior on windows.

And Mac #136258

@JacksonKearl JacksonKearl added bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues workbench-multiroot Multi-root (multiple folders) issues labels Feb 3, 2022
@JacksonKearl JacksonKearl added this to the On Deck milestone Feb 3, 2022
@lramos15 lramos15 assigned lramos15 and unassigned JacksonKearl May 25, 2022
@dynalz
Copy link

dynalz commented Jun 11, 2022

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?

@starball5
Copy link

@xaxazak
Copy link

xaxazak commented Dec 4, 2023

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

@bpasero
Copy link
Member

bpasero commented Apr 25, 2024

We have logic to refresh the explorer whenever the window gets focus:

// Refresh explorer when window gets focus to compensate for missing file events #126817
this.disposables.add(hostService.onDidChangeFocus(hasFocus => {
if (hasFocus) {
this.refresh(false);
}
}));

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 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug file-explorer Explorer widget issues workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

No branches or pull requests

8 participants