44 Rectangle Gaps Between Windows

The short version: run defaults write com.knollsoft.Rectangle gapSize -float 8 in Terminal, then quit and relaunch Rectangle. Snapped windows will now sit inside a margin instead of flush against each other. Eight pixels suits most screens; the rest of this covers picking the right number for your display, what happens when gaps meet edge margins, and the two situations where the spacing looks wrong through no fault of the setting.

The command

Open Terminal and run:

defaults write com.knollsoft.Rectangle gapSize -float 8

Then quit Rectangle from its menu bar icon and launch it again. This step is not optional and it’s where most people get stuck — Rectangle reads preferences at launch, so a value written while it’s running does nothing visible. Closing the settings window doesn’t count as quitting.

Snap two windows side by side to check the result. There should be space between them and a margin at the screen edges.

To change the value, run the command again with a different number and relaunch. To remove gaps entirely:

defaults delete com.knollsoft.Rectangle gapSize

Nothing here touches the system — com.knollsoft.Rectangle is the app’s own preference domain, and the delete command puts it back exactly as it was.

Picking a number for your screen

Gap size is measured in points, not physical pixels, which matters on Retina displays: the value behaves consistently across resolutions rather than halving on a high-density panel. That’s the behavior you want, and it means the same number is portable between machines.

Rough guidance by display, from a lot of fiddling:

13- to 14-inch laptop. Four to six. You do not have pixels to spare. At eight, a half-screen window on a small panel starts feeling cramped in a way you’ll blame on the app rather than the setting.

24- to 27-inch external. Eight to ten. This is the sweet spot the default recommendation is aimed at — clearly visible separation, no meaningful loss of working area.

32-inch and up, or an ultrawide. Twelve to sixteen. Larger gaps read as intentional design rather than as accident, and on a very wide screen the space between columns genuinely helps your eye separate them.

Above twenty. Only if you’re going for a look. Past this point you’re donating real estate to whitespace, and the windows start feeling like they’re floating rather than tiled.

One thing that trips people: the perceived gap between two windows is the full value, while the perceived margin at a screen edge is also the full value — so the outer border and the inner divisions look consistent. If you expected the outer margin to be half, that’s the assumption to drop.

Gaps versus edge margins

Rectangle has a second, separate mechanism for reserving space at screen boundaries, with individual values per edge. It exists for a different reason: something living at a screen edge that windows shouldn’t cover — a dock in an unusual position, a wide menu bar readout, a stream overlay, or a display whose last centimeter is physically hard to read.

The two features stack. At the screen boundary, your gap value and your edge margin add together, so a gap of eight plus a top margin of twenty gives you twenty-eight points of space at the top and eight between windows. That’s a legitimate configuration, but it’s rarely what someone intended when they set both without checking.

Tune one at a time. Set your gap first, live with it for a day, then add edge margins only if something specific requires them. Chasing an asymmetry you accidentally created is a bad way to spend an evening.

The edge-margin keys follow the same defaults write pattern within the same domain; take the current key names from Rectangle’s documentation rather than an old forum post, since these have been renamed at least once.

When the spacing looks wrong and it isn’t the setting

Two situations produce gaps that appear uneven, and neither is a bug in the value you chose.

Applications with their own invisible padding. Some windows draw a transparent border or a shadow region that counts as part of the window frame. Rectangle positions the frame correctly, but what you see is the visible content inset a few points further in. The result is one window that looks like it has a bigger gap than its neighbour. There’s no fix — it’s the app’s own drawing — but knowing the cause stops you from tuning the value back and forth trying to correct it.

Fractional display scaling. If you run a scaled resolution rather than a native one, positions land on fractional pixel boundaries and get rounded. On a two-column split this can produce a one-pixel difference between the left gap and the right, visible only if you’re the sort of person who notices one pixel. Which, if you’re reading an article about window gaps, you may well be. Switching to a native scaling mode removes it; nothing else will.

Why anyone bothers

Worth a paragraph, because “make windows smaller for no functional reason” is a fair objection.

Flush-tiled windows merge visually. Two applications sharing a border with similar background colors read as one continuous surface, and your eye has to work to find the seam. A gap gives each window an outline, and the desktop showing through provides a reference point that makes the boundary obvious without any conscious effort.

There’s also the borrowed aesthetic. Gaps have been standard in Linux tiling window managers for years, where the configuration and the screenshots that come with it are part of the culture. A lot of people arriving at this setting on macOS are reproducing something they liked elsewhere, and that’s a perfectly good reason.

And it’s two lines to try and one to undo. Unlike most configuration decisions, this one costs nothing to evaluate empirically — set it, work for a day, decide.

If you want the wider set of hidden preferences in the same family, the Rectangle app has a handful more worth knowing, all written the same way into the same domain. Gaps are just the one with the most immediately visible payoff, which is why it’s usually the first that people who tile windows on a Mac go looking for.

Frequently asked questions

Why is nothing different after running the command?

Rectangle reads preferences at launch, so a value written while it’s running takes effect only after you quit from the menu bar icon and relaunch. Closing the settings window isn’t quitting.

What gap size should I use?

Eight is a good default. Under four is barely visible; over sixteen costs real working area, which bites hardest on a laptop. Large external displays handle bigger values comfortably.

Do gaps apply to the screen edges too?

Yes — the value adds space at the outer boundary as well as between windows. If you also set separate edge margins, the two add together at the screen edge, so tune one at a time.

Previous Article