handle embedded newlines in stack/output