Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Some line control characters are shown R console #322

Open
dongikjang opened this Issue Jan 22, 2014 · 6 comments

Comments

Projects
None yet
5 participants

I an using SublimeREPL under Ubuntu 13.10.
The version of sublimetext is build 3059.

When "eval in REPL with selection",
"CR<" and "BEL" character string are added in the R console.
Furthermore, long input code line is truncated and print the initial input again with "CR<" character string
repl
.

I think line control characters are added automatically.

vyakimov commented Feb 5, 2014

I can confirm I am experiencing the same issue.

screen shot 2014-02-05 at 15 27 45

As a holdover, add the following above self._view.run_command("repl_insert_text", {"pos": self._output_end, "text": unistr}) in sublimerepl.py (should be line ~320):

        brstr = re.compile(r'[\r\n]{1,2}<.*(?= {24})')
        try:
            lchar = brstr.finditer(unistr)
            for i in reversed(list(lchar)):
                rchar = i.group(0)[-1]
                unistr = brstr.sub(rchar, unistr)
        except:
            unistr=unistr

This will solve the carriage return garbling.

*edit: Better regex

You can fix the BEL problem by setting "translate_tabs_to_spaces": true in your preferences file. Or by adding

unistr = re.sub(r'\a',r'\t', unistr)

above or below the lines in my first comment.

I too have this issue, though only with . Tried to the solution in #155 and that didn't seem to help. Still getting the CR.

@ghost

ghost commented Mar 20, 2016

your solution didn't work for me Mac OS 10.10.5, using SublimeREPL for Scala and for Spark.
i did a slight modification.

add the following above self._view.run_command("repl_insert_text", {"pos": self._output_end, "text": unistr}) in sublimerepl.py (at line 321):

unistr = re.sub(r'\r', '\n', unistr); unistr = re.sub(r' \| ', '', unistr)

looks like dirty hack to me, but does the job of clearing up noise from console

I am experiencing the same issue when using SublimeREPL with Clojure. I assume the origin of the behavior is also the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment