I’ve come up with a better work-around for this problem. I can change:
set result [system foo.sh 1>&2]
to
set result [catch {exec sh -c “foo.sh 2>&1” >@ stdout}]
This means that I can only get success/failure of the command and not exact return codes, but that doesn’t bother me too much.
I think the problem is that Cloverleaf has modified the TCL “stdout” channel so that it no longer refers to the operating system “stdout” file descriptor. This seems like a bad decision to me.