add script_colorsafe for capturing colorized output