capture rich output as well as stdout/err in capture_output

closes #3742