code: def _preloop_hook(self) -> None:
          
          # This runs after cmdloop() acquires self.terminal_lock, which will be locked until the prompt appears.
          # Therefore this is the best place to start the alerter thread since there is no risk of it alerting
          # before the prompt is displayed. You can also start it via a command if its not something that should
          # be running during the entire application. See do_start_alerts().
          self._stop_thread = False
  
          self._alerter_thread = threading.Thread(name='alerter', target=self._alerter_thread_func)
          self._alerter_thread.start()
docs: Start the alerter thread