The CoreDisplay Framework
When you connect an external monitor to your MacBook—whether it is a simple 1080p HDMI display, a high-end 6K Apple Pro Display XDR, or an iPad acting as a Sidecar display—the macOS hardware negotiation is handled by the CoreDisplay framework.
CoreDisplay is responsible for polling the monitor’s EDID (Extended Display Identification Data) to understand its resolution, refresh rate, and color space capabilities. To speed up future connections, CoreDisplay caches these hardware profiles heavily in the system preferences.
If this cache becomes corrupted—often due to cheap USB-C hubs sending malformed EDID data, or connecting and disconnecting multiple different monitors in rapid succession—the symptoms are highly disruptive. macOS might completely fail to detect an external monitor (even though it provides power), it might lock the monitor to a blurry, unchangeable 720p resolution, or the “Displays” section in System Settings might instantly crash when opened. Restarting the Mac rarely fixes this because the corrupted EDID profile is persistently saved to the SSD. You must forcefully purge the CoreDisplay cache via the Terminal.
Locating the Display Caches
The display profiles are highly privileged, hardware-level configurations stored in the /Library/Preferences/ and the volatile /var/db/ system directories.
Because they control the physical GPU output, you cannot delete them using the standard Finder GUI.
Purging the Cache via Terminal
You must use the Terminal with elevated (sudo) privileges.
- Unplug all external monitors and USB-C hubs from your Mac. (This is critical to prevent the corrupted data from immediately regenerating).
- Open the Terminal application.
- First, delete the primary WindowServer display preference file, which holds the arrangement, resolution, and refresh rate history for all known monitors:
sudo rm -f /Library/Preferences/com.apple.windowserver.plist
sudo rm -f ~/Library/Preferences/ByHost/com.apple.windowserver.*.plist
Press Enter, type your Mac’s administrator password (the characters will remain invisible), and press Enter again.
- Next, forcefully flush the volatile CoreDisplay preference cache held in the system directory:
sudo rm -f /var/db/CoreDuet/Knowledge/knowledgeC.db
sudo rm -f /Library/Preferences/com.apple.CoreDisplay.plist
(Note: If the CoreDisplay.plist file does not exist, do not worry; it is only generated when specific override profiles are active).
Restarting the WindowServer
Deleting the configuration files removes the corrupted state from the hard drive, but the WindowServer daemon is still actively running in RAM using the broken profiles.
You must forcefully terminate the WindowServer.
WARNING: Executing the following command will instantly log you out of your Mac and immediately kill all open applications without saving. Save any open documents before proceeding.
sudo killall WindowServer
The Hardware Handshake
Your MacBook screen will instantly go black, and you will be dropped back to the macOS login screen.
Log back into your Mac. The CoreDisplay framework has now been completely reset to factory defaults.
Now, plug your external monitor directly into your Mac. The CoreDisplay daemon will perform a clean, fresh EDID handshake with the monitor, generating a brand new, uncorrupted preference file. Your monitor will instantly wake up at its maximum supported resolution and refresh rate, completely resolving the hardware detection failure.