[entity] only print a trailing newline if stdout is a terminal