code: def _on_resize(self):
          
          # Erase, request position (when cursor is at the start position)
          # and redraw again. -- The order is important.
          self.renderer.erase(leave_alternate_screen=False, erase_title=False)
          self.renderer.request_absolute_cursor_position()
          self._redraw()
docs: When the window size changes, we erase the current output and request
          again the cursor position. When the CPR answer arrives, the output is
          drawn again.