VSCode - Open terminals in a separate window

18,420

Solution 1

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 with Terminal: 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.

enter image description here

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.

terminals in editors demo

The new terminal.integrated.defaultLocation setting can be set to editor to direct newly created terminals to the editor area by default.

Solution 2

Please Try:

  1. File > Open New Window
  2. Ctrl+Shift+P > Terminal: Create New Terminal in Editor Area

You can add keybinding to the commands as per your convenience.

Solution 3

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.

Maximized Terminal Pane

Solution 4

You can create a new window by going to File>New Window and then open up a new terminal inside of it. Inside the new terminal you can go to your folder by using "cd your\projectfolder\path". And here you are, you have a terminal for your project inside it's own seperate window (I'm actualy using it like this too.) I hope this answered your question. Have a nice day, DevMo.

Solution 5

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.

Share:
18,420
Imonitmedia
Author by

Imonitmedia

An experienced, ambitious and self-motivated Front end / React developer with over 19 years of experience in the industry. Has a very keen interest in emerging web technologies, advancing web for mobile, satisfying requirements for accessibility and providing a great user experience. Works very well independently but is also a solid team player who thrives on creating engaging creative solutions and who would like to work closely with teams of like-minded developers. Has a strong driving force for improving the performance, scalability and reliability of development projects. And is continuously seeking to build upon existing skills and break into working with brand new frameworks and technologies as they are released and put to test on the web. Please check my examples on GitHub https://github.com/ImonitMedia

Updated on June 10, 2022

Comments

  • Imonitmedia
    Imonitmedia almost 2 years

    in VSCode is it possible to open the terminals in a separate window? So far my research has pointed to a resounding NO but Im curious if anyone has a solution?

  • Sohrab
    Sohrab almost 3 years
    What is the point of that?Why not just open a terminal window and maximize that? cmd? powershell? or sth?
  • Mi Be
    Mi Be over 2 years
    It gives me following error: The active editor must contain an openable resource.
  • Ahmad Ismail
    Ahmad Ismail over 2 years
    @MiBe thanks for the feedback. I have edited the answer. Please let me know if you find any more issues.
  • Mi Be
    Mi Be over 2 years
    It works. Thanks
  • Themelis
    Themelis over 2 years
    In my case I want to match the theme of the editor + terminal
  • John Henckel
    John Henckel about 2 years
    I 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.