Re: [Rd] buggy ANSI escape sequences in R prompt

2017-02-07 Thread Hugo Raguet
Thanks for the hint. I agree with your analysis, but that still would not explain why the continuation overrides the begining of the same line instead of going to the next line. I think I'll go for the two-lines prompt. If you have a Stack Overflow account, you can post your answer and I will accep

Re: [Rd] buggy ANSI escape sequences in R prompt

2017-02-07 Thread Gábor Csárdi
I guess that R does not know about ANSI sequences, and it calculates the width of the prompt including the characters in the sequences. You cannot do much about this, except maybe use a prompt that has two lines. You can put the colored text and whatever you like in the first line, and the second l

[Rd] buggy ANSI escape sequences in R prompt

2017-02-07 Thread Hugo Raguet
When R is run interactively in a terminal which supports colors, it is possible to use ANSI escape sequences in order to put colors in the prompt, such as options(prompt = "\033[0;31mThis is red\033[0m> ") Unfortunately, something goes wrong because for long command lines, the line continuation o