8

I've started using iTerm2. I like the functionality of splitting panels using

Cmd + d

and

Cmd + Shift + d

But how can I undo this splitting?


In the standard terminal Cmd + d can be undone using Cmd + Shift + d, but in iTerm it's used for horizontal split.

informatik01
  • 16,038
  • 10
  • 74
  • 104
igx
  • 4,101
  • 11
  • 43
  • 88

1 Answers1

6

I like the functionality of splitting panels using Cmd + d

Note that whilst this even in iTerm2's official docs is described as Split Panes

Split Panes

iTerm2 allows you to divide a tab into many rectangular "panes", each of which is a different terminal session. The shortcuts cmd-d and cmd-shift-d divide an existing session vertically or horizontally, respectively. You can navigate among split panes with cmd-opt-arrow or cmd-[ and cmd-]. You can "maximize" the current pane--hiding all others in that tab--with cmd-shift-enter. Pressing the shortcut again restores the hidden panes.

if you only start with a single terminal session, the splitting comes with the side effect of starting another session. As per the docs, you can either maximize a single pane using

Cmd + Shift + Enter

which leaves the hidden panes alive as active terminal sessions. Moreover, you can kill the terminal session of the active pane using

Cmd + w

Which comes with the iTerm2 side effect that the corresponding pane will also be closed.

Note that repeated use of Cmd + w will, after closing all terminal sessions, eventually close the final terminal session and the iTerm2 tab itself.

Example of Cmd + w to close terminal session (with the effect of closing the panes that used to hold them):

enter image description here

dfrib
  • 70,367
  • 12
  • 127
  • 192
  • I like the blue arrow showing your current directory. What plugin is that? – Dagrooms Nov 03 '17 at 14:48
  • @Dagrooms [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), using a tweaked agnostic theme, I believe. Note that you will need to install some powerline fonts to use the fancier themes such as agnostic (especially for its annotation features when the `pwd` is in a git repo. – dfrib Nov 03 '17 at 18:14
  • 5
    This does not undo the split, it just exits the terminal that the cursor is in. – Henry Grantham Jan 19 '18 at 23:10
  • @HenryGrantham Answer updated to clarify this (as well as expanded with pane maximization). – dfrib Aug 27 '21 at 07:30