Truncated the last char from the server output to stdout and stderr to prevent duplicated newline