Almost all Tcl scripts work identically when their output is directed to a terminal or to a file. While there is a tcl_interactive
variable that things could be keyed off, it doesn't come into play when you're supplying the script as an argument. The other base-line difference is that stdout
will have different buffering by default; you can change that to be defined with:
fconfigure stdout -buffering none ;# Or “line” or “full”
However, I would expect the differences there to make things (very marginally) less likely to work in the case of being redirected to a file. Whatever is going on (and I bet it either involves running subprocesses or the use of extension packages) I can't guess it on the basis of the evidence provided.