Forrest logo
back to the code tool

code:tldr:58afc

code: Open specific files/directories in a new window.
$ code --new-window ${filename_or_directory1 filename_or_directory2 ---}
try on your machine

The command "code --new-window ${filename_or_directory1 filename_or_directory2 ---}" is used to open multiple files or directories in separate windows in Visual Studio Code.

Here's a breakdown of the command:

  • "code": It refers to the command-line utility of Visual Studio Code.
  • "--new-window": This flag is used to open a new instance/window of Visual Studio Code.
  • "${filename_or_directory1 filename_or_directory2 ---}": This is a placeholder for the files or directories you want to open. You can specify multiple files or directories in this placeholder, separated by spaces.

For example, if you want to open three files named "file1.txt", "file2.txt", and "file3.txt", you can use the command like this:

code --new-window file1.txt file2.txt file3.txt

This will open each file in a separate window in Visual Studio Code, allowing you to work on them simultaneously.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the code tool