101

Suppose you have a terminal with two tabs. You click, drag, and let go one of these tabs and it becomes an independent terminal window. After a while, you want to take this terminal window and reattach it as a tab to the previous window. How do you do it ? I have seen the merge windows option in the menus, but that merges all windows into one, which I would then have to revert.

6 Answers 6

140

You need to, in the window you want to move, go to View-> Show Tab Bar (if the tab bar isn't showing already).

Then, drag the tab of the window you want to move onto the window you want to move it to.

Update for iTerm 2: In iTerm 2 the setting is no longer exposed in the View menu. Go to iTerm > Preferences > Appearance > Tabs and check "Show tab bar even when there is only one tab". Note that in early releases of iTerm 2 the setting was "Hide tab bar when there is only one tab".

iTerm Screenshot

5
  • 2
    For this and other reasons, I always have the tab bar visible. I recommend doing so, because tabs have several useful status/activity indicators (starting in Mac OS X 10.7 Lion).
    – Chris Page
    Apr 9, 2012 at 11:47
  • 3
    I've tried Cmd+Shift+Option to click and drag iTerm2 tabs into other windows, but it only works with normal windows. How can I merge tabs back into the Hotkey Window (I'm using iTerm2 in visor / yakuake-like mode)
    – TrinitronX
    Sep 5, 2013 at 16:51
  • 5
    You can also Cmd+t to create a new tab and tab bar will automatically visible
    – czerasz
    Nov 8, 2013 at 10:09
  • It's called "Show toolbar" in my version. The tab bar is always visible, but you cannot drag one tab into another window unless the toolbar is showing.
    – keflavich
    Apr 21, 2014 at 23:22
  • 1
    on the latest iterm2, showing one tab and dragging doesn't seem to work for me, so i need to do cmd+t to create a second tab. Jul 20, 2021 at 17:49
34

The answer is to hold down command + shift + option whilst dragging the body of the terminal (not the tab) back to the terminal you wish to merge.

Source: http://azaleasays.com/2014/03/05/iterm2-merge-a-pane-back-to-window-or-tab-bar/

4
  • 7
    Note that this is for iTerm2 and not for Terminal. Apr 29, 2019 at 22:20
  • 1
    Also if you have multiple split panes in your tab, this moves each one individually rather than the whole tab in one go.
    – Tamlyn
    May 17, 2019 at 12:36
  • I'm glad Apple's products are so intuitive.
    – Leo
    Jun 22, 2020 at 3:20
  • There is a youtube video on this: youtube.com/watch?v=xJzBd7GQlUo
    – nom-mon-ir
    Sep 15, 2020 at 4:40
10

I have iTerm2 (Build 1.0.0.20130302) here - there's no View > Show Tab Bar. But as Chris Page suggested, disabling Hide tab bar when there is only one tab (in Preferences > Appearance) helps. The single windows can then be moved and merged again.

2
  • 9
    If you just have 1 tab and thus no tab bar, temporarily make a new tab, move away the tab you want, and then murder the temporary tab. Aug 25, 2015 at 13:37
  • @DanJameson someone made an official answer from your post but I'm up-voting you 1) because it worked and 2) the use of the word murder Oct 17, 2021 at 0:00
4

You need to click and drag the tab from one window onto the tab bar of the other window to reattach it.

If either window has no tab bar because it is currently showing only one tab, Command + T to open a new tab, perform the action, then close any tabs you don't need. This works for both Terminal and iTerm2.

Full credit to Dan Jameson in the comments for this obvious solution.

2
  • simple & works great. life quality increase: priceless. thank you! Oct 30, 2020 at 3:18
  • How can Apple break such a simple UX thing xD
    – Mihkel L.
    Jan 11, 2022 at 12:44
3

I had troubles merging windows with the Hotkey Window profile. I eventually found a way to un-split the windows by doing the following:

  1. Preferences > uncheck Hide tab bar when there is only one tab
  2. Set Tab position to Bottom
  3. Press your hotkey to show the Hotkey Window
  4. Click & drag the tab into the Hotkey Window's tab bar
1
  • I just open another tab when I need to drag a tab into hotkey window. Jul 19 at 0:33
2

For Terminal (as opposed to Terminal2):

If the window you want to attach has just one tab (I.e. no tab bar) then add another tab. Then drag the tab of the one you want to the tab bar of the window you want to add it to.

I found it took a bit of jiggling before th image changed from an thumb nail of the window to just the tab. This is the signal that your are in the right place!

It took me a while to realise I needed to add another tab but is is logical.

1
  • Thanks. Adding another tab, to be able to drag from the tab bar, is what worked for me. Really unintuitive from Apple :(
    – maccaroo
    Jan 12 at 3:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .