'Writes output from Repl into this view.'

def write(self, unistr):

    if self._filter_color_codes:
        unistr = re.sub(u'\\033\\[\\d*(;\\d*)?\\w', u'', unistr)
        unistr = re.sub(u'.\\x08', u'', unistr)
    self._view.run_command(u'repl_insert_text', {u'pos': (self._output_end - self._prompt_size), u'text': unistr})
    self._output_end += len(unistr)
    self._view.show(self.input_region)
