Fix printing a prompt after newlines in response