Chris Sutcliffe dixit:

>Not sure if my mailer killed the escape sequences or not, but I don't see
>any '\r' in the example you provided.

OK, then let’s send the stuff either uuencoded, or use the
generic $'…' escaping form.

>to colour the return code red, if I understand correctly, I should do:
>
>       (( e )) && REPLY+="\001[31m\001$e|"

No.

To colour something red, you send:
        ESC [ 3 1 m

To “escape” something from being counted for the prompt width,
you wrap it (on both sides) in a byte that tells mksh to ignore
it. The byte you must define yourself, but it must be something
not otherwise used in the prompt text. You do that by using it
as first byte of the PS1 and ASCII CR as second byte of it.

The manpage even has got examples on how to do that, as does
dot.mkshrc (minus actually using colourising).

So how about, you send me the prompt you want to have, possibly
with colourising, as uuencode, and I’ll send it back? (You can
also send it in GNU bash syntax…)

bye,
//mirabilos
-- 
[ Natureshadow über meine Tendenz, seine IRL-Aussprüche zu siggen ]
(er) „Du bist besser als Twitter“
(ich) „Wieso? Weil ich das Wichtige herausfiltere?“
(er) „Und weil Du einfacher zu bedienen bist“

Reply via email to