Remove Mac maximize window left margin

When maximizing a Mac window with the green button, it will not maximize to full size, but have a little left margin from the left side.

Window with left margin

I guess there is no setting to change that, but that margin has to have a specific size defined. Is there any kind of terminal command I can run to decrease the left margin to 0?

I know there are apps which can position windows to any prefered position and size, but I is there a way to do it without one?

The strange thing is, that it does maximize to full size without a margin on the right screen when you've got a second display connected.


The 4 pixel margin is shown on the side of the screen the Dock is on.

I don't know any way to remove it other than to disable Dock:

launchctl unload /System/Library/LaunchAgents/com.apple.Dock.plist

However that also disables Mission Control and the application switcher, and it makes full screen windows stop working.