code: async def addSignalHandlers(self):
          '''
          Register SIGINT signal handler with the ioloop to cancel the currently running cmdloop task.
          '''
  
          def sigint():
              self.printf('<ctrl-c>')
              if self.cmdtask is not None:
                  self.cmdtask.cancel()
  
          self.loop.add_signal_handler(signal.SIGINT, sigintync def addSignalHandlers(self):
          '''
          Register SIGINT signal handler with the ioloop to cancel the currently running cmdloop task.
          '''
  
          def sigint():
              self.printf('<ctrl-c>')
              if self.cmdtask is not None:
                  self.cmdtask.cancel()
  
          self.loop.add_signal_handler(signal.SIGINT, sigint)
docs: Register SIGINT signal handler with the ioloop to cancel the currently running cmdloop task.