Colours in console maxima?



That's terrific - just what I wanted!  Thank you very much.

-Alasdair

On Sat, Sep 13, 2008 at 5:07 AM, James Amundson <
amundson at users.sourceforge.net> wrote:

> Alasdair McAndrew wrote:
>
>> I've gone back to using maxima in console mode in an xterm, at least
>> temporarily.  It would be nice to have colours though: different colours for
>> prompts, input, output, help, strings etc.  Would this be hard to implement?
>>
> I think it's a great idea to have a few colors to distinguish elements of
> the console interface. I wish I had thought of it myself. The existing
> external interface makes it easy to add a few colors. I've attached a
> proof-of-concept implementation, colorterm.lisp. You can either do
>   load("colorterm.lisp");colorterm();
> or stick colorterm.lisp in your $HOME/.maxima directory and add the above
> line to maxima-init.mac in that directory.
>
> --Jim
>
>
> ;;; Default colors. For color mappings, see comments below.
> (defvar *prompt-color* 31)
> (defvar *input-color* 34)
> (defvar *output-color* 30)
> ;;;  Foreground Colours
> ;;;  30 Black
> ;;;  31 Red
> ;;;  32 Green
> ;;;  33 Yellow
> ;;;  34 Blue
> ;;;  35 Magenta
> ;;;  36 Cyan
> ;;;  37 White
>
> (defun $colorterm ()
>    (let ((escape-char (code-char 27)))
>        (setf *prompt-prefix*
>            (format nil "~a[00;~am" escape-char *prompt-color*))
>        (setf *prompt-suffix*
>            (format nil "~a[00;~am" escape-char *input-color*))
>        (setf *general-display-prefix*
>            (format nil "~a[00;~am" escape-char *output-color*))
>        (setf *maxima-epilog*
>            (format nil "~a[00m" escape-char))))
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>


-- 
Blog: http://amca01.wordpress.com