[racket] Reliably disable/redirect console output

From: Erich Rast (erich at snafu.de)
Date: Mon Oct 17 15:21:44 EDT 2011

Is it possible to reliably disable/supress or redirect the console error
and the ordinary output in a GRacket application?

I tried:

(let ((out (open-output-string))
        (err (open-output-string)))
    (parameterize ((current-output-port out)
                   (current-error-port err))

at the topmost place that opens the first window but it doesn't work, at
least not in each and every case (why not?)

I have an application that on windows outputs one or two #t whose origin
are a bit hard to track down in all the source modules, which means that
a console window shows up on Windows every time.

Posted on the users mailing list.