code: def run_in_terminal(self, func, render_cli_done=False, cooked_mode=True):
          
          # Draw interface in 'done' state, or erase.
          if render_cli_done:
              self._return_value = True
              self._redraw()
              self.renderer.reset()  # Make sure to disable mouse mode, etc...
          else:
              self.renderer.erase()
          self._return_value = None
  
          # Run system command.
          if cooked_mode:
              with self.input.cooked_mode():
                  result = func()
          else:
              result = func()
  
          # Redraw interface again.
          self.renderer.reset()
          self.renderer.request_absolute_cursor_position()
          self._redraw()
  
          return result
docs: Run function on the terminal above the prompt.
  
          What this does is first hiding the prompt, then running this callable
          (which can safely output to the terminal), and then again rendering the
          prompt which causes the output of this function to scroll above the
          prompt.
  
          :param func: The callable to execute.
          :param render_cli_done: When True, render the interface in the
                  'Done' state first, then execute the function. If False,
                  erase the interface first.
          :param cooked_mode: When True (the default), switch the input to
                  cooked mode while executing the function.
  
          :returns: the result of `func`.