This and downwards is to repaint the prompt when you change colors/chars. But perhaps we could skip it.  It is not changed that often and it will be changed by next prompt output anyways. A lot of complexity for a small use-case.