Fix prompt length issue where we lose a character when scrolling through history