The Dizzying Display
macOS supports a wide variety of external monitors, many of which are designed to physically rotate on their stands to be used in a vertical (portrait) orientation. This is highly popular among programmers for viewing long blocks of code or writers drafting long documents. When you connect a modern monitor with a built-in gyroscope or orientation sensor, macOS may attempt to be helpful by automatically detecting the physical rotation and changing the digital display orientation to match. However, if the sensor is overly sensitive, or if you are simply adjusting the monitor’s height and tilt, the screen might automatically rotate back and forth, disrupting your workspace layout and causing momentary black screens.
Locking the Display Orientation
To stop macOS from automatically changing your display’s orientation based on sensor data, you must manually lock the rotation setting within the Displays preference pane.
Connect your external monitor and arrange it physically exactly how you intend to use it. Open the System Settings app (click the Apple logo in the top-left corner, then System Settings). In the left-hand sidebar, scroll down and click on Displays. In the main pane, click on the icon representing your external monitor (not your built-in MacBook screen). Look for the drop-down menu labeled Rotation. If your monitor supports automatic detection, it might be set to “Standard” with an auto-detect hidden flag, or “Automatic.” Click the drop-down menu and explicitly force it to your desired orientation. Select Standard for a normal horizontal layout, or 90° / 270° for a locked portrait layout. By manually defining the exact degree of rotation, you override any automatic sensor input, ensuring the screen remains permanently locked in your chosen orientation regardless of how the physical display is jostled.