code: def abort(self):
          
          on_abort = self.application.on_abort
          self._abort_flag = True
          self._redraw()
  
          if on_abort == AbortAction.RAISE_EXCEPTION:
              def keyboard_interrupt():
                  raise KeyboardInterrupt()
              self._set_return_callable(keyboard_interrupt)
  
          elif on_abort == AbortAction.RETRY:
              self.reset()
              self.renderer.request_absolute_cursor_position()
              self.current_buffer.reset()
  
          elif on_abort == AbortAction.RETURN_NONE:
              self.set_return_value(None)
docs: Set abort. When Control-C has been pressed.