>>>>> "Robert" == Robert Dodier <robert.dodier at gmail.com> writes:
Robert> On 2012-10-31, Ranousse <ranousse at gmx.com> wrote:
>> It doesn't surprise me, since I think there's something missing in the
>> solution. When colorizing prompts (bash, lftp or octave for instance) I
>> usually use a string like this one
>> start: "\[\e[35m\]"
>> end: "\[\e[m\]"
>> In the previous example the \[ and \] around text are missing.
Robert> Well, you can edit the strings in colorterm.lisp, which I did, as shown
Robert> by the patch below. But when I run the modified colorterm function, I
Robert> just get extra square brackets in the output. I tried it with terminal
Robert> 0.2.8 and xterm 229 (on an xubuntu system). I also tried it with zero or
Robert> two backslashes before each square bracket -- same result.
I'm pretty sure that for bash (and gnu readline) the \[ and \] is
interpreted by bash to indicate that the stuff in between takes up no
display space so that command-line editing works.
Maxima's prompt processor isn't that smart. And IIRC, maxima doesn't
support command-line editing unless the underlying lisp does. In that
case, the prompt probably has to be hooked into the underlying lisp to
tell it what's going on.
Ray