Strange... this might be peculiar to running a program from the IDE.
Compiling to an executable, and then running the executable does not exhibit this behaviour.
So, case closed.
Compiling to an executable, and then running the executable does not exhibit this behaviour.
So, case closed.