Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code opens multiple instances

Two days ago, I installed Visual Studio Code, and it worked pretty fine. But now as I am opening Visual Studio Code, it's opening multiple instances. How can I solve it?

It seems Visual Studio Code opens every file present in the directory in another window. How can I solve that?

like image 761
Aviral Goel Avatar asked Nov 02 '25 22:11

Aviral Goel


1 Answers

I had similar problems as well (the second action in my answer should solve your problem). My system was suddenly "laggy" as well, with no prior sign of significant damage. My windows self-restarted on its own. I attempted to fix the problem, but it still didn't resolve it. When I use the command:

code .

on the command line to open a folder in the Visual Studio Code editor, it opens multiple instances of the windows tab. Below is how I tackled the two problems:

Two things (actions)

First action (targeted: Laggy Windows OS)

I used the command prompt (in system administrator mode) to run the command (System File Checker):

sfc /scannow

This action fixed some corrupt system file and solved the laggy nature. I noticed significant improvement, possibly restoring it to previous performance level. Check the Microsoft documentation for more information.

Second action (Visual Studio Code opens multiple instances)

Open the Visual Studio Code editor, go to the setting and paste this in the search bar (e.g., Ctrl + ,):

"workbench.editor.enablePreview": false

If you have this option marked, you should unmark it or set it to false depending on the interface you are presented and interacting with. This should stop Visual Studio Code from running multiple instances and hopefully resolve your problem.

like image 55
SamBuilds Avatar answered Nov 05 '25 14:11

SamBuilds



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!