How do I remove display configurations or reset display persistence in macOS?

Last Update: October 1st, 2024
Article ID: 1344577

Apple macOS systems can support one or more external displays, but sometimes the display settings can become stuck in a non-working configuration causing a wide range of issues from displays not displaying anything, to extended displays being stranded from the main display and being inaccessible.

For example if an external display is set to be rotated 90° into portrait mode and is then connected to the computer using a different graphics adapter or port it can cause the macOS window manager to crash, reverting to the user login screen.  To resolve this the display can be disconnected from the computer and all stored display settings can be removed, when the display is reconnected it will be rotated normally in landscape mode.

Apple macOS stores display configuration information including the resolution, position, rotation, and color profiles for external displays in two locations:

  1. User display configuration is stored in the /home/{username}/Library/Preferences/ByHost/com.apple.windowserver.{uniqueID}.plist file
  2. System display configuration is stored in the /Library/Preferences/com.apple.windowserver.plist file

Sometimes the configuration files may become corrupted causing display settings to not be retained on reboot, wake from sleep, or even simply logging out and back in. It is also possible that incorrectly configured display settings can cause the window manager to crash at login bringing you back to the login prompt.

Deleting these two files will reset the window configuration and allow you to reconfigure the connected displays just like their first connection to the computer. The system-wide configuration file requires administrative permissions to delete or modify, while the user file can be modified by the logged in user.

Warning: Modifying system files is not without risk, before proceeding we recommend creating a full system backup.

How to delete these files:

  1. Disconnect the external displays from the computer (for a Mac Mini connect one display directly to the computer's HDMI output)
  2. Open a terminal window: Select Finder > Go > Utilities > Terminal
  3. Once in the terminal application please note that when typing in the following commands that Capitalization and spacing matters. You can also copy and paste the commands if preferred:

    3a. Type in the following command and press 'Return' to remove the user-specific configuration file for the currently logged in user:
    rm ~/Library/Preferences/ByHost/com.apple.windowserver.*.plist

    3b. Type in the following command and press 'Return' to remove the system-wide configuration file (requires root/administrative permissions*):
    sudo rm /Library/Preferences/com.apple.windowserver.plist

    *If prompted for your root/administrator password, please type the password and press 'Return'. You will not see the password as you type it nor will the cursor move, this is expected.

  4. Restart the computer: Apple Menu > Restart
  5. Log into the user account
  6. Reconnect the external displays and configure their resolution, position, and rotation like normal