I've been grappling with this issue for the past month or so, and it seems my computer has a few different quirks / snags. But I can add some things I know haven't worked, and what seems to have triggered this, so maybe we can figure it out.
(rMBP, 13", 2013)
Basic problem: After sleep or startup, mac boots to a black screen. No cursor, no dimly lit info. Happened randomly at first, but more consistently until finally always boots this way. Can show that computer is on with Caps lock. Can only view screen through external screen connected by HDMI.
When booting up normally, gets stuck during or before apple bootup logo. Can boot into single-user mode, safe-mode, and recovery mode. But again, screen only shows up on external. (Don't know what variations you guys run into).
Things that don't work:
1) Resetting SMC
2) Resetting VRAM
3) Deleting com.apple.loginwindow.plist.
4) Repairing disk/permissions with applejack.
After wiping hard drive, reinstalling Mavericks instead of El Capitan, it stayed dark for one evening, then booted up in the morning!
Things worked for about a week until Sunday, when I did two things:
1) Installed STEAM and played a few games for about an hour
2) Watched Bob's Burger's on an external TV connected by HDMI
The following day, after closing and opening lid, I get the black screen again! Hmm... So I safe-booted (being able to see the desktop through an hdmi connected tv), made sure all display and power settings were set at default, deleted Steam, deleted Popcorn Time.
Still dark, left it overnight to recharge. Next day while at work, I walked down to a different tv, connected my computer by HDMI and booted into single user mode. Single-user mode worked on the INTERNAL display, nothing on the external. Used applejack to delete the user caches. Lots of files deleted.
Booted normally, everything worked (with a tiny blip during load, but otherwise fine). So in the end, I don't know what has fixed it but when I looked at the bar at the top of the screen, I saw the "Mirroring displays" menu icon, which should only be there when a display is connected... I clicked on it and it only showed the preferences menu, and when I unchecked the preference to show this, it went away and did not come back when rechecked.
So based on what happened, I think I can narrow it down to either
1) the increased GPU load from the game, or
2) connecting to an external monitor via hdmi. I think it's this one.
Does anyone know anything about what's going on when the graphics card detects an external monitor? What settings/preferences get changed? Where these changes are stored?