To open multiple instances of Visual Studio Code on Windows or macOS, there are several methods you can use:
Method 1: Using the New Window Option
- Open an already running instance of Visual Studio Code.
- Click the 'File' menu (Windows) or 'File' menu (Mac).
- Select 'New Window' (a new window will open).
- In the new window, you can open a different project or folder to run multiple instances.
Method 2: Opening Directly from the Command Line
On Windows or macOS, you can use the following command to open a new Visual Studio Code instance:
bashcode -n /path/to/directory
Here, /path/to/directory is the path to the directory you want to open in the new instance. The -n flag ensures a new window is opened.
For example, if I want to open the project located at C:\Projects\MyProject in a new instance, I would enter in the command line:
bashcode -n C:\Projects\MyProject
Method 3: Opening from the Taskbar or Dock
- Windows: Locate the pinned Visual Studio Code icon in the taskbar, then hold down the
Shiftkey while clicking it to open a new instance. - Mac: Find the Visual Studio Code icon in the Dock, then right-click and select 'New Window'.
Use Case Example
Suppose I am developing a frontend project and also need to view and debug a related backend API project. I can open two Visual Studio Code instances—one for the frontend project and another for the backend project. This allows for more convenient cross-project work without constantly switching between different project folders in the same window.
These are several methods to open multiple instances of Visual Studio Code. I hope this information is helpful to you!