'Handles characters seen when in an escape sequence.
Most non-VT52 commands start with a left-bracket after the
escape and then a stream of parameters and a command; with
a single notable exception -- :data:`escape.DECOM` sequence,
which starts with a sharp.
.. versionchanged:: 0.4.10
For compatibility with Linux terminal stream also recognizes
``ESC % C`` sequences for selecting control character set.
However, in the current version these are no-op.'

def _escape(self, char):

    if (char == u'#'):
        self.state = u'sharp'
    elif (char == u'%'):
        self.state = u'percent'
    elif (char == u'['):
        self.state = u'arguments'
    elif (char in u'()'):
        self.state = u'charset'
        self.flags[u'mode'] = char
    else:
        self.dispatch(self.escape[char])
