The ANSI ending escape sequence is now always placed before the last newline.
This fixes some weirdness of the cursor or other parts being coloured when they should not be.
Authored by: bugman 2012-04-17
Parent: [r15774]
Child: [r15776]