Filter terminal escape sequences

Prevent terminal escape sequences from being passed through to outputters when they don't belong there.