I've foud a couple of "hackish" ways to do this and am considering attempting to do this in a less "hackish" way - however I'm a bit unsure of how to get the state in the first place (can't find any indication of it being stored anywhere).
The "hackish" solutions all seem to write to a scratch file somewhere in the filesystem and then display the files contents in the header of the console page.
Any pointers?