def ansi_to_curses(self, char):
<EOL>if char != ESC:<EOL><INDENT>return char<EOL><DEDENT>if self.getc(block=True) != ANSI_START_SEQ:<EOL><INDENT>self._readline_echo(BELL, True)<EOL>return theNULL<EOL><DEDENT>key = self.getc(block=True)<EOL>try:<EOL><INDENT>return ANSI_KEY_TO_CURSES[key]<EOL><DEDENT>except:<EOL><INDENT>self._readline_echo(BELL, True)<EOL>return theNULL<EOL><DEDENT>
Handles reading ANSI escape sequences