code: def run(self, reset_current_buffer=False, pre_run=None):
          
          assert pre_run is None or callable(pre_run)
  
          try:
              self._is_running = True
  
              self.on_start.fire()
              self.reset()
  
              # Call pre_run.
              self._pre_run(pre_run)
  
              # Run eventloop in raw mode.
              with self.input.raw_mode():
                  self.renderer.request_absolute_cursor_position()
                  self._redraw()
  
                  self.eventloop.run(self.input, self.create_eventloop_callbacks())
          finally:
              # Clean up renderer. (This will leave the alternate screen, if we use
              # that.)
  
              # If exit/abort haven't been called set, but another exception was
              # thrown instead for some reason, make sure that we redraw in exit
              # mode.
              if not self.is_done:
                  self._exit_flag = True
                  self._redraw()
  
              self.renderer.reset()
              self.on_stop.fire()
              self._is_running = False
  
          # Return result.
          return self.return_value()
docs: Read input from the command line.
          This runs the eventloop until a return value has been set.
  
          :param reset_current_buffer: XXX: Not used anymore.
          :param pre_run: Callable that is called right after the reset has taken
              place. This allows custom initialisation.