MBP 2012 13" freezes unless connected to external display
I guess I have the opposite problem of everyone in here.
My MBP freezes just a few seconds after booting up. I can't move the mouse and type anything.
However, if I connect the MBP to an external display tru HDMI or thunderbolt port, the macbook works fine. I have no problem at all using it. If I disconnect the external display it will freeze right away. Sometimes I can unfreeze it by reconnecting the display.
It currently has 10.11.5, but the problem started about 2 months ago when it still ran 10.9.
Unfortunately the warranty expires. If anyone has any clue what's going on, please let me know.
Thanks.
MacBook Pro with Retina display, OS X El Capitan (10.11.5)