Dear list,

I would like to know if there is any way to include xterm escape sequences in 
R's prompt using options( prompt= XXX, continue= XXX ), where XXX can contain, 
for example, "\033[1;31mRed" for chancing text color to red (see 
http://www.frexx.de/xterm-256-notes/).
If you do this, the color escape sequences work (with an appropriate terminal 
emulator, e.g., xterm under Linux), providing you with a colored R prompt. 
However, when using the command history (arrow up/down) the edit line gets 
messed up because the algorithm counts the escape sequence not as a single char 
but as multiple. Thus, I was wondering if there would be any way to tell 
options(prompt) not only the string but also the number of characters in the 
string (of course, defaulting to strlen).

The specific reason I ask this question is because I have recently written a 
gedit plug-in for R, allowing it to become a lightweight IDE for R 
(http://sourceforge.net/projects/rgedit/) and one feature I would like to have 
is colored prompts (to make the R console easier to navigate through). Alas, as 
I said before, using options() with escape sequences kind of works as long as 
you don't use the command history (implemented in my rgedit but disabled by 
default).

Thanks you in advance,
Dan

                                          
_________________________________________________________________


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to