def METHOD_NAME(self, text):
    """Data read from pty; send to frontend"""
    updated_text = text
    if self.term_command == 'cmd':
        xterm_escape = re.compile(r'(?:\x1B\]0;).*\x07')
        updated_text = xterm_escape.sub('', text)
    self.send_json_message(["stdout", updated_text])