3

TL;DR: In RGUI and ESS, what are the didBecomeActive messages and how do I suppress them?


Working with the OSX RGUI 3.0.3 in OSX 10.9.2, the console displays what look like logging messages Whenever the RGUI app becomes active. See the screenshot below

RGUI

Something similar happens in when I interact with R from within emacs, using ESS. Usually this happens whenever I use the default graphic device, for example invoking a simple plot function. When I close the window containing the graph or simply refocus to emacs another didBecomeActive message. With ESS this is particularly annoying because the buffer has become read-only and I cannot directly interact with the console (a workaround is to C-c C-q to try and quit the R process but then cancel the request with c).

ESS

The question

These seem to be related problems. What are these messages? How can I suppress them? How can I regain control of the R console automatically in Emacs/ESS after having used a graphical device?


Edit

These messages are logged in system.log and seem to trickle down unfiltered onto the R console. Here is an extract

Mar 14 12:56:41 xxx-mbp.att.net Google Chrome[1075]: didBecomeActive!
Mar 14 12:56:44 xxx-mbp.att.net Adium[17018]: didBecomeActive!
Mar 14 12:56:45 xxx-mbp.att.net Emacs[5455]: didBecomeActive!
Mar 14 12:56:46 xxx-mbp.att.net Google Chrome[1075]: didBecomeActive!
Mar 14 12:56:47 xxx-mbp.att.net R[16531]: didBecomeActive!
Mar 14 12:56:49 xxx-mbp.att.net Google Chrome[1075]: didBecomeActive!
Mar 14 12:56:53 xxx-mbp.att.net R[16531]: didBecomeActive!
Mar 14 12:56:54 xxx-mbp.att.net Emacs[5455]: didBecomeActive!
Mar 14 12:56:56 xxx-mbp.att.net Google Chrome[1075]: didBecomeActive!
Ryogi
  • 5,497
  • 5
  • 26
  • 46

2 Answers2

2

This has nothing to do with R. A quick search turns up didBecomeActive referenced in relation to GKTurnBasedEventListener on Apple's developer site. You may have (had?) a turn-based game running elsewhere on your system (which may have crashed and lost its way leaving a thread still running) and your R session is getting signals meant for the "old" pid. A quick reboot should fix it or open a new terminal and ps aux to possibly see the errant thread and kill -9 it.

Patrick
  • 91
  • 3
  • Thanks for your answer. Unfortunately rebooting does not help. I had the same issue on different machines and versions of OSX (10.7, 10.8, 10.9). No games on any of these machines. – Ryogi Mar 14 '14 at 20:44
2

This isn't a proper answer, but you may be able to at least avoid this by redirecting stderr to a file when you start it up ?

rcmd > stdout.log 2> stderr.log

You may also be able to play with the R sink() function to try to suppress this stuff.

Dylan
  • 530
  • 2
  • 11