Can anyone explain how the OP's solution works, in particular the chvt 3/7? I looked up chvt and it seems like it would switch a different terminal into the foreground, but this raises more questions than it answers.
Like how does he know what 3 and 7 have on them? And would this work on a windowing system? And why does it appear as if the screen has turned off?