code: def execute(self, command, args):
          
          self.fire_event('precmd', command, args)
          try:
              try:
                  result = command.run_wrap(args)
              except BaseException as e:
                  self.fire_event('postcmd', command, args, exc=e)
                  raise e
              else:
                  self.fire_event('postcmd', command, args, result=result)
                  return result
          except BrokenPipeError as e:
              _vprinterr('<dim><red>...broken pipe...</red></dim>')
              raise SystemExit(1) from e
          except KeyboardInterrupt as e:
              _vprinterr('<dim><red>...interrupted...</red></dim>')
              raise SystemExit(1) from e
          except SystemExit as e:
              if e.args and not isinstance(e.args[0], int):
                  _vprinterr("<red>%s</red>" % e)
                  raise SystemExit(1) from e
              raise e
          except Exception as e:
              self.handle_command_error(command, args, e)
              raise SystemExit(1) from e
docs: Event firing and exception conversion around command execution.
          Common exceptions are run through our exception handler for
          pretty-printing or debugging and then converted to SystemExit so the
          interpretor will exit without further ado (or be caught if
          interactive).