Handle carriage returns in input