VScode(suddenly) will not open a folder
Asked Answered
A

5

6

edit: Rebooting fixed the problem. I'm still wondering what could have caused it in the first place because this happened once before, but I don't remember what I did to fix it then (at that time a reboot did NOT fix the problem).

I cd to the folder containing the files I wish to edit and from the command line type: code . and VScode opens normally except there are no files listed in explorer to be opened, only the message: "You have not yet opened a folder." I then click on the "Open Folder" button, select the folder I wish to open, and get the exact same result: "You have not yet opened a folder."

I've Googled this and searched here on Stackoverflow but came up with no results. VScode has been working find since last December and I haven't added any new extensions. I'm using a MacBook Pro, not Windows or Linux if that makes any difference.

I've also tried to open the folder by specifying it explicitly: code /Users/davidoliver/sites/todo-redux

Albertinealbertite answered 5/7, 2020 at 20:38 Comment(2)
I am having the same experience.Stolzer
Restarting vscode worked for me.Whopping
A
4

Seems like shutting it down and restarting VSCode seems to clear up the issue. Sometimes I have to reboot my computer to get it to work correctly. Also make sure that you are not trying to open any subfolders of the main folder. All the information about the project is stored only in the main folder.

Albertinealbertite answered 9/11, 2020 at 18:21 Comment(0)
R
1

I hit the same issue on my Mac. When I ran code --verbose . the message indicated there was already a running instance of vscode, even though no windows were showing. Instead of rebooting I ran ps -ef | grep -i "vscode" to find and kill all these instances. After this the program is working as expected.

Rayon answered 2/12, 2021 at 14:51 Comment(0)
P
0

SSH connection folder opening issue

If the folder in question is on a server you are connecting to through SSH, consider that there may be a hanging VSCode process that was previously attached to the folder, and that disallows re-opening it.

This can happen despite closing and re-opening any VSCode instance.

Rebooting the machine helped me in this scenario.

Pome answered 19/8, 2022 at 11:3 Comment(0)
C
0

On mac, make sure that VS code was closed by clicking on the apple icon > force quit > VS Code. Restarting after this solved the issue for me.

Centriole answered 14/3, 2023 at 19:59 Comment(0)
O
0

I feel silly, but just had what I thought was this issue. I had the sidebar hidden so there actually wasn't any change to code when it opened the folder, but it was in fact open. So check to see if the sidebar is displayed before going through a reboot.

Oldwife answered 4/7 at 18:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.