Fix bug when writing a line that goes over the right prompt.