Bug fix. Discount the characters of ANSI color control sequences.
Without discounting them they cause the input area to start too far right to end of the prompt.
Comment tweaks and indentation.