the lines you send out here may be in the middle of the command output which may cause the output results looks weird and the remove_last_nonempty_line remove useful lines in the bottom.