Fixed writeLastLine for windows terminal.