How do you unsplit an editor, go back from 2 code views to 1, same with terminal

How do you unsplit an editor, go back from 2 code views to 1, same with terminal.


Editor Groups

To "unsplit" editor groups without closing any open files, use the menu-bars: View > Editor Layout > Single (or, while in the editor, press and release ALT and then type vls).

Editor groups are also closed by default when they become empty. You can empty an editor group by closing tabs/files or by dragging all of the tabs from that group to another.

Hints:

  • Grabbing the area to the right of the tabs allows you to drag/drop all tabs in a group at once.
  • The "Open Editors" section of the "Explorer" panel lets you use CTRL and SHIFT to select and drag/close multiple editors at once. (If you don't have an "Open Editors" section, use the "..." menu of the Explorer panel to enable it.)

Terminal Groups

Terminals work differently than editor groups and are more limited:

You can open new terminal groups by pressing the '+' icon in the terminal tab of the panel.

"Splitting" a terminal (done by clicking the split icon in the terminal tab of the panel) really just opens an additional terminal in the same group and displays it side-by-side with the others in the group.

So, two ways to "unsplit" terminals:

  • Kill terminals (e.g. with the trashcan icon) until there is only one left in the group.
  • Switch to a new terminal group with only a single terminal in it.

(as of Visual Studio Code version 1.29.1)


By mouse

To close or unsplit a split Editor you need to

  • either close all the tabs in the split side you want to close
  • or right-click on one of the tabs in the section you want to close and select Close All.

By keyboard To close or unsplit split Terminals:

type exit in the terminal you want to close.

Note

The split Editors will not close when you close the tabs if you have in your settings "workbench.editor.closeEmptyGroup" : false


Editors:

View: Join Editor Group with Next Group workbench.action.joinTwoGroups

View: Join All Editor Groups workbench.action.joinAllGroups

Terminal:

Terminal: Kill the Active Terminal Instance workbench.action.terminal.kill