The right solution, which we've probably halfway already done
if I remember correctly, is to write a Sage function called
"run_command" that resets the environment as you suggest
above, runs the subcommand, and returns. This should be
completely transparent to the user, and should do the right
thing on Linux, OS X, etc. Then the animate command
would call convert via run_command instead of os.system.
William
See http://trac.sagemath.org/sage_trac/ticket/975 for a solution that is
already put in place. Basically, use
$SAGE_ROOT/local/bin/sage-native-execute, which does exactly what
mabshoff says above.
Thanks,
Jason