Sub topic 6
Moving tabs between windows and merging windows
This chapter assumes you can open, switch, and close tabs, and that you know the tab bar and the sidebar from the earlier chapters. You don't need profiles yet. They matter only in the edge cases near the end. Menu names can vary slightly between macOS versions, so check your own Window menu if a label differs.
Why move tabs between windows
Tabs pile up in whichever window you happened to be in when you opened them. Moving tabs lets you:
- Split a crowded window into two focused windows, for example one for research and one for email.
- Put two pages side by side on screen by giving each its own window.
- Gather scattered windows back into one tidy window.
Safari has three tools for this: pulling a tab out into its own window, dropping a tab into another window, and merging every window into one.
Moving one tab into a new window
You can detach a tab in three ways. All three give the same result: the tab leaves its window and appears in a new one, with its back and forward history intact.
- Drag the tab down and away from the tab bar, then release it over the desktop or an empty area. A new window forms around the tab.
- Control-click (or right-click) the tab and choose Move to New Window.
- Select the tab, then choose Window > Move Tab to New Window from the menu bar.
The menu command is the most dependable because it needs no precise dragging. If the tab is the only one in its window, the command has nothing to detach, so it is dimmed or does nothing useful.
Moving a tab into another window
To combine tabs from two windows, drag a tab from one window's tab bar and drop it onto the tab bar of another Safari window. A gap opens where the tab will land. Release the mouse button to drop it. The tab leaves the first window and joins the second.
Some details to watch for:
- The target needs a visible tab bar. A window with a single tab may hide its tab bar. Choose View > Show Tab Bar in the target window first.
- Sidebar users can drag there too. If the target window shows the sidebar, drop the tab into the sidebar's list instead.
- Dropping position is the order. The tab sits where you released it, and you can drag it again to reorder.
- A dragged tab does not copy. The original window loses the tab. If the original window has no tabs left, it closes.
You can also drag a tab by its address in the Smart Search field. Dragging the small site icon at the left of the field out of the window creates a link, not a moved tab. For moving tabs, always start from the tab itself.
Merging all windows
When you have many windows open, moving tabs one at a time is slow. Choose Window > Merge All Windows. Safari takes the tabs from every open regular window and places them in one window.
Expect these results:
- The tab count in the merged window is the sum of the tab counts in the old windows, except where pinned tabs are shared (see below).
- The windows you merged disappear. Tab order follows the windows' order on screen, but don't rely on a specific arrangement. Check the result in Tab Overview or the sidebar.
- You can reverse the merge only by hand, by detaching tabs again. Safari has no "unmerge" command. Press Command-Z? It will not restore the old windows. If you might want the old grouping back, save the tabs in a tab group first (covered in a later chapter).
Checking the result with AppleScript
If you want an exact count instead of eyeballing it, the Automation approach from the last chapter works here too. This script lists the number of tabs in each open Safari window, front window first.
tell application "Safari"
set tabCounts to {}
repeat with w in windows
set end of tabCounts to (count of tabs of w)
end repeat
return tabCounts
end tellRun it in Script Editor before and after Merge All Windows. Before, you might see {3, 2, 4}. After, expect one number. macOS may ask you to allow automation access the first time. A differing total usually means shared pinned tabs were counted once, or a Private Browsing window was left out of the merge.
Edge cases and gotchas
Pinned tabs
Pinned tabs are shared across the windows of the same profile. The same pinned sites appear at the left of each window's tab bar. When you merge windows, Safari keeps one copy of each pinned site instead of stacking duplicates. So the merged count can be smaller than the sum. Dragging a pinned tab out of the tab bar into a new window unpins it in practice, because the new window already shows your pinned set. If a tab you expected to move is still in the old window, check whether it was pinned.
Tab groups
A Safari window shows either its own loose tabs or one tab group at a time. This has two effects:
- If you drop a tab into a window that is showing a tab group, the tab becomes part of that group.
- If you move a tab out of a group window into a window showing no group, it is no longer in the group. Check the sidebar to confirm.
The context menu also has Move to Tab Group, which moves a tab into a chosen group without dragging.
Private Browsing windows
Private Browsing windows are separate from regular windows. You can't drag a tab between a private window and a regular one, and Merge All Windows won't fold private tabs into a regular window. This protects the separation: a private tab never silently joins history-saving browsing. If you want a private page in a regular window, copy its address and open it in the regular window. Keep in mind that the page then loads again as a regular visit and is saved to your history.
Profiles
Each window belongs to one profile, and a profile keeps its own history, tab groups, and similar data. Treat windows from different profiles like windows from different worlds. Tabs belong with their profile's windows, and the menu may refuse to merge or move across them. If a drag or merge doesn't behave as you expect, check which profile each window uses in its toolbar or sidebar, and use File > New [Profile] Window to open a window in the right one. Profiles need Safari 17 or later on macOS Sonoma 14 or later.
Full-screen and Spaces
A window in full-screen mode lives in its own Space. You can drag a tab onto it only if you can bring both windows into view. In practice, leave full-screen mode first (Control-Command-F), then move the tab.
Quick reference
| Goal | Method |
|---|---|
| Detach one tab | Drag it off the tab bar, or **Window > Move Tab to New Window** |
| Detach from the context menu | Control-click the tab, then **Move to New Window** |
| Add a tab to another window | Drag it onto that window's tab bar or sidebar |
| Combine all regular windows | **Window > Merge All Windows** |
| Put a tab into a tab group | Control-click, then **Move to Tab Group** |
Troubleshooting
- The tab won't detach. It is the only tab in its window. Open a second tab first.
- The drop target ignored the tab. Show its tab bar with View > Show Tab Bar, or drop into its sidebar.
- Merge All Windows is dimmed. You have only one regular window open, or your windows are in different profiles or full-screen Spaces.
- Tab count after merging is lower than expected. Duplicated pinned tabs were combined.
- Private tabs didn't move. They never merge with regular windows by design.
Exercise
You have three regular windows with 4, 3, and 5 tabs. Two of the windows share the same two pinned sites, and each window displays those pinned tabs. You also have one Private Browsing window with 2 tabs. After you choose Window > Merge All Windows, roughly how many windows remain, and what should the AppleScript count script report for the regular window? Explain your reasoning, and give one way to recover the old grouping if you regret merging.
Show answer
Two windows remain: one merged regular window and the untouched Private Browsing window, which never merges with regular windows. The merged window's tab count is at most 12 (4 + 3 + 5). Pinned tabs are shared across windows of the same profile, so they are counted once rather than once per window. The script's number is therefore 12 minus the duplicated pinned copies, not simply 12. The Private Browsing window's 2 tabs are separate. Safari has no unmerge, so to recover the old grouping you detach tabs again with Move Tab to New Window or by dragging. The better habit is to save the related tabs as a tab group before merging.