'Rewinds the terminal cursor to the beginning and writes the given line.
:kwarg erase: if True, will also add spaces until the full terminal width to ensure
previous lines are properly erased.
The rest of the keyword arguments are markup instructions.'

def rewrite(self, line, **markup):

    erase = markup.pop('erase', False)
    if erase:
        fill_count = (self._tw.fullwidth - len(line))
        fill = ('    ' * fill_count)
    else:
        fill = ''
    line = str(line)
    self._tw.write((('\r' + line) + fill), **markup)
