In VS Code, is it possible to open the terminals in a separate window? So far my research has pointed to a resounding no, but I'm curious if anyone has a solution or workaround.
-
related question: [Visual Studio Code open tab in new window](https://stackoverflow.com/q/43362133/11107541) – starball May 10 '23 at 03:12
12 Answers
Move terminals between windows
It's now possible to move terminals between windows by detaching via
Terminal: Detach Session
in one and attaching to another withTerminal: Attach to Session
. In the future this should help enable cross-window drag and drop!
Lots of changes in v1.58: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_58.md#terminals-in-the-editor-area
For v1.59 moving the terminal changes - including dragging and dropping onto another window, see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_59.md#drag-and-drop-terminals-across-windows
Drag and drop terminals across windows
Drag terminals from the tabs list or editor area of one window into the tabs list, editor area, or panel of another window.
Terminals in the editor area
Terminals can now be created in or moved to the editor area, enabling a multi-dimensional grid layout that persists and remains visible regardless of panel state.
To use terminals in the editor area, there are several options:
Create via the Create Terminal in Editor Area command.
Move a terminal from the panel to the editor by dragging and dropping from the tabs list.
Running Move Terminal into Editor Area with a terminal focused.
Moving into the editor area via the terminal tab context menu action.
The new terminal.integrated.defaultLocation
setting can be set to editor to direct newly created terminals to the editor area by default.

- 143,421
- 24
- 428
- 436
-
1I am using Python and when I press F5 to debug it always opens a terminal in the **same window** as my source code. I don't like that. I want F5 to open the terminal in a different window. I guess the best solution is to open the same project and python environment in a different window, and then if I want to debug, I have to Ctrl-K+S in one window, click the other window, and then hit F5. Not very convenient though. – John Henckel Mar 03 '22 at 18:24
-
Just a note: if you work with remote connections only a window that is connected to the same remote can detach/attach or drag'n'drop (which is in effect just detach, attach + position) – Simon Sobisch Mar 09 '23 at 10:57
Please Try:
File > Open New Window
- Ctrl+Shift+P >
Terminal: Create New Terminal in Editor Area
You can add keybinding to the commands at your convenience.

- 11,636
- 6
- 52
- 87
-
It gives me following error: The active editor must contain an openable resource. – Mi Be Oct 02 '21 at 11:26
-
@MiBe thanks for the feedback. I have edited the answer. Please let me know if you find any more issues. – Ahmad Ismail Oct 02 '21 at 12:45
i think that the OP wants to create a separate window for the terminal but still have the separated terminal linked to the code editor in the original window (that's what i want too). so that when you run the code in the editor the output is shown in the terminal in the separate window. but if you simply open up a new window of vscode and either open a terminal there or drag and drop the terminal from the original window into the new window, the new terminal is not the same session of the terminal. it is a separate independent unconnected terminal. running the code in the editor does not show output in the new separate terminal. all you have achieved is creating a new unconnected terminal. which you could have just accomplished by opening up a regular terminal window i.e. the one from windows os main menu, no need even to use vscode.

- 131
- 1
- 3
This answer is now outdated. See this answer for instructions on moving terminal panes between VS Code windows. This answer still works but is no longer a necessary workaround.
You can't detach the panes in VSCode, which IMO is a bit of a pain since Visual Studio can detach panes all day long.
There is a workaround though, you can open a new window in VSCode and maximize the terminal pane in that window.

- 19,553
- 20
- 90
- 159
-
13What is the point of that?Why not just open a terminal window and maximize that? cmd? powershell? or sth? – Sohrab Jun 01 '21 at 05:52
-
1
-
@Sohrab There might be some extensions that will open a terminal in VSCode, like Stripe. – A. Atal Feb 22 '23 at 22:14
One reason you'd want to do this is to have the Python terminal on a second monitor while still being able to use Python interactively (shift
+enter
way). Attaching/detaching didn't work for me, nor can you open separate terminals.
What you can do is simply resize your one window across the screen borders! Then right click on the terminal tab/header and click Move panel to the left
and voila!

- 472
- 5
- 12
-
1This "Move Panel to Left" is excellent for wide-screen monitors. Thank you. Your solution works perfectly. – Rohit Nov 30 '22 at 19:49
-
1
- Create a new window by going to File → New Window.
- Open up a new terminal inside of it.
- Go to your folder (
cd your\projectfolder\path
).
And here you are, you have a terminal for your project inside it's own seperate window.

- 5,031
- 17
- 33
- 41

- 21
- 1
Try Сtrl+Shift+c. For me, it opens the folder the script is within in a command prompt window.

- 39
- 5
The ideal case of what you're asking for is tracked by two issue tickets that are still open (not implemented):
Allow for floating windows #10121 (a more general request covering all Panels)
You can give those issue tickets a thumbs up reaction to show support for them getting implemented, and subscribe to them to get notified about discussions and updates. But please don't make a "me too" comment. "me too" comments generally come off as annoying to repo maintainers because they clutter up discussion and don't contribute anything of significant value.
As for workarounds, you can create a new and empty VS Code window (with no workspace folder), and drag the terminal from your pre-existing window into that one. You can also detach the session from one VS Code window, and then reattach it into another one (using the Terminal: Detach Session
and Terminal: Attach to Session
commands in the command palette respectively). See also the user docs.

- 20,030
- 7
- 43
- 238
As far as I know, there is no way to split a terminal window with VS Code. Because I also searched the way a lot. Maybe you imagine like below.
Instead, I recommend using the 'Tab' style. That means using the terminal as one of the editing tabs like Python file. It's very convenient for me.
You can also find the button like below.
Then, you can bind the menu with a shortcut. I prefer to set Ctrl+KM.
In the shortcut menu, search "move terminal into editor area"
End!

- 41
- 4
You can change the terminal to be side-by-side instead of below the editor. And then make your window very wide. It is almost as good as having two windows.
- Right click on the TERMINAL tab.
- Select "Move Views to Side Panel"
- Make your window very wide

- 10,274
- 3
- 79
- 79
It seems VS Code allows you to detach the terminal window, but it then will not show the output from the editor of the window you detached it from.
I have spent a while searching, and there is really no workaround other than to just run whatever file you are trying to debug from a separate terminal from the same CWD. This also means you will need to save the file in the window you are editing the file in every time you want to run it. huge pain.

- 57
- 7
If you are using PowerShell inside the VSCode terminal, why don't you use the PowerShell console from the start menu. It's basically equivalent to using the terminal in separate windows. Hope it helps.Sample

- 1
- 2