def METHOD_NAME(self, char: int) -> int:
    """Handle the input from the user.
    :param char: The character input from the user
    :returns: 0 if the window needs to be resized
              1 if the window should be repainted
              -1 if the window should be closed
    """
    # in the case the term returns 127 instead of 263
    if char == curses_ascii.DEL:
        char = curses.KEY_BACKSPACE
    if char == curses.KEY_IC:
        self.insert_mode = not self.insert_mode
        ret = 1
    elif char == curses_ascii.ESC:
        ret = -1
    elif char == curses.KEY_RESIZE:
        ret = 0
    elif char in (curses_ascii.SO, curses.KEY_DOWN):
        if self.input_line_cache:
            if not self._arrowing:
                self.input_line_pointer = 0
                self._arrowing = True
            else:
                self._adjust_line_pointer(1)
                self._paint_from_line_cache()
        ret = 1
    elif char in (curses_ascii.DLE, curses.KEY_UP):
        if self.input_line_cache:
            if not self._arrowing:
                self.input_line_pointer = len(self.input_line_cache) - 1
                self._arrowing = True
            else:
                self._adjust_line_pointer(-1)
                self._paint_from_line_cache()
        ret = 1
    elif char == curses_ascii.TAB:
        ret = 0
    else:
        ret = bool(self.do_command(char))  # type: ignore[func-returns-value]
        self._arrowing = 0
    return ret