By commands, you probably mean "escape sequences", which are not the same as running executables and isn't very dangerous.
If a terminal actually executed commands based on data printed to stdout, that would be a very significant vulnerability. It seems far more likely that the gibberish you're talking about is the usual mess of escape sequences.