Macos – Bring OS X Error Message window to the front

macoswindow

In OS X, when an application crashes, a window with an error report will appear. That window is by default unreachable by Command+Tab nor does it appear in the Dock. Of course, if by error or on purpose one clicks another window, the error report will go to the background and hide behind the other windows.

This is really annoying, because in order to see it, I will have to use Exposé and scan through 20+ Windows in order to find it. (Not to say, that I don’t like Exposé anymore since Snow Leopard made the window sizes all confusingly equal.)

Any ideas on how to make the error reports Command+Tabbable?

Best Answer

Fun question. Short answer:

sudo defaults write "/System/Library/CoreServices/Problem Reporter.app/Contents/Info" LSUIElement -bool false

That should cause Problem Reporter to show up in the Dock the next time it is run.

How I arrived at the answer: When a crash occurs, /System/Library/CoreServices/ReportCrash is run by launchd according to one of the com.apple.ReportCrash*.plist files in /System/Library/Launch{Daemons,Agents}/. This is responsible for generating the crash report you'll find in [~]/Library/Logs/CrashReporter/ or [~]/Library/Logs/DiagnosticReports.

It looks like ReportCrash might be able to initiate display of a dialog similar the "Problem Report for APP" dialog – it contains the string "/System/Library/PrivateFrameworks/CrashReporterSupport.framework", which is what contains the resources used to localize the text displayed in the dialog window. It also contains calls to the CFUserNotification API. But the ReportCrash process exits after a while, while the dialog continues to display. (The CFUserNotification approach is most likely a fallback in case _CROpenProblemReport, which has the CrashReporterSupport private framework open the application you're seeing, fails.)

Guess what keeps running? /System/Library/CoreServices/Problem\ Reporter.app. If you open this file, the problem report dialog comes to the fore. The reason you can't see this in the Dock or the Cmd-Tab list is because its Info.plist file contains the entry LSUIElement = 1.

I bet you can make it so you can see it in the Dock and Cmd-Tab to it by changing the value of the LSUIElement to <false/> in /System/Library/CoreServices/Problem\ Reporter.app/Contents/Info.plist.

Related Question