How to disable VSCode's Explorer opening directory of opened file?

Viewed 321

I'm using VSCode (1.47.3) on Ubuntu Bionic with the MS Python Extension Pack. I really want to disable the feature whereby Explorer decides to open the parent folder of the file I have just opened and allow me the control to open this folder manually (if I want to, which I rarely do).

Scenario:

  1. I have some app-specific .py files open and Explorer shows my app's folder: "app" - all good.
  2. I navigate to a DJango dependency e.g. models.Manager when suddenly Explorer automatically shows the folder: site-packages/django/db/models - which I don't to happen. I didn't ask it to happen.

In order to go back to the context of my top-level "app" folder, I have to scroll 100km back to where I was! I just want Explorer to stay in my "app" directory, regardless of what other files I may open.

I only opened the DJango dependency for context/reference. I have no intention of editing that file (obviously) so I don't need any other DJango context. If I want to open a parent directory of a random file I've opened, I'll do that myself.

How can I disable VSCode from doing this? Is there some JSON config I can modify?

1 Answers

So I Googled this again and within minutes found an answer that I swear I had never come across before.

The setting I was after was:

"explorer.autoReveal": false

Described very well in the following issue from 2016: https://github.com/Microsoft/vscode/issues/14745

Related