I use my MacBook at work and at home. Whenever I switch between work and home, every now and again I get bug whereby the Mac thinks an external monitor is still plugged in, even if it's not.

This means when I go to plug in either my work or home monitors, one of them doesn't work as OS X still thinks there is a different monitor plugged in.

The only way I've been able to fix this is to restart, but I was hoping there was a quick way to fix this through a terminal command or something.

Note that System Preferences > Displays > Option + Detect Displays does not work.

  • 1
    The same thing keeps happening to me. In my case, I use a MBP and an HP thunderbolt display. I haven't been able to confirm, but I think, that I can reproduce this by either A) quickly closing the lid and unplugging the laptop (from power, the external display, and usb hub), or B) -- the inverse -- unplugging the laptop and quickly closing the lid. – sanscore Aug 8 '16 at 16:05
  • My suspicion is that OS X, in either case, it starts a coroutine to go from two displays to one, but when the power supply is cut off and the lid is closed, then it is forced into hibernation and interrupting display reconfiguration routine. (I, accidentally, submitted my comment prematurely and I've missed the edit window.) – sanscore Aug 8 '16 at 16:13

Go into System Preferences->Displays and when there (doesn't matter which tab) press the 'Option/ALT' key and you'll see 'Detect Displays' where the 'Gather Windows' button is (on 10.13.x) or simply in the lower right on 10.14.x (as this page doesn't have a 'Gather Windows' button.)

| improve this answer | |
  • 3
    This is exactly what the OP said he/she already tried, without success. – radiaph Jan 8 at 15:37
  • Goops! Missed that in his last line! – Mark A. Donohoe Jan 8 at 15:46
  • 1
    Ah a hidden feature! In my case clicking "Detect Displays" locked up the computer - mouse wouldn't move, nothing. Had to reboot 🤦‍♂️ There's something very flaky with the display support – Anentropic May 15 at 11:07

Since at least OS X El Capitan (Version 11.x), you can force Detect Displays using Command-IncreaseBrightness (Cmd-F2 key on MacBook Pro, or Cmd-fn-F2 if you have function keys turned on).

I had a similar problem with my 13" MBP, where when I disconnected an external display it didn't detect that it should switch to the single, built-in display – regardless of whether the machine was already sleeping or the lid were quickly closed. Cmd-F2 worked for forcing the machine to detect that the only available display was the built-in one.

As a bonus, you can also toggle Display Mirroring using Cmd-DecreaseBrightness (Cmd-F1...). Hit it again to toggle back.

Hope this helps!

| improve this answer | |
  • 1
    slight caveat: new macbook pro doesn't have an F2 button... – Axel Polleres Aug 4 '17 at 5:57
  • Yes, but it also works with Touch Bar icons. – Hrvoje Zlatar Mar 20 '18 at 7:48
  • 3
    Does not work with my Touch Bar icons, High Sierra 10.13.4. Sure, the FN keys are visible, but no combination of special keys and Touch Bar settings will allow me to invoke Detect Displays. However, using an external keyboard, everything works as expected. – ken Aug 6 '18 at 20:02
  • 1
    Is there a solution for this yet? Can't get cmd-f2 to work on 10.15.6 (16"mbp 2019). My MB thinks it's connected to the DELL (24" from the office, not the 34" LG it's actually connected to, resulting in 2 very big bars on either side of the screen). Rebooting fixed this in the past, but rebooting sucks, so i'd love a command line option. – BlkPengu Oct 3 at 17:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .