'starts the REPL'

def run(self):

    telemetry.start()
    from azure.cli.core.application import APPLICATION
    APPLICATION.get_progress_controller = self.progress_patch
    self.command_table_thread = LoadCommandTableThread(restart_completer, self)
    self.command_table_thread.start()
    from azclishell.configuration import SHELL_HELP
    self.cli.buffers[u'symbols'].reset(initial_document=Document(u'{}'.format(SHELL_HELP)))
    while True:
        try:
            try:
                document = self.cli.run(reset_current_buffer=True)
                text = document.text
                if (not text):
                    self.set_prompt()
                    continue
                cmd = text
                outside = False
            except AttributeError:
                break
            else:
                (b_flag, c_flag, outside, cmd) = self._special_cases(text, cmd, outside)
                if (not self.default_command):
                    self.history.append(text)
                if b_flag:
                    break
                if c_flag:
                    self.set_prompt()
                    continue
                self.set_prompt()
                if outside:
                    subprocess.Popen(cmd, shell=True).communicate()
                else:
                    self.cli_execute(cmd)
                    cli_telemetry.conclude()
        except (KeyboardInterrupt, ValueError):
            self.set_prompt()
            continue
    print(u'Have    a    lovely    day!!', file=self.output)
    telemetry.conclude()
