简体   繁体   中英

VScode(suddenly) will not open a folder

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

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.

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" ps -ef | grep -i "vscode" to find and kill all these instances. After this the program is working as expected.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM