Change text color in Common Lisp REPL

I would like to control the color of the text displayed in Common Lisp. Something like this pseudo code:

(print-color (:red "hello") (:blue "world"))

Can this be done? I use SBCL and my repl is inside emacs. Thank!

+4
source share
1 answer

You can use the ANSI delete code to print colored texts:

(format t "~c[31mabc~c[0m~%" #\ESC #\ESC) ; this prints a red "abc" for most modern terminals

I'm not sure if this works in slime though.

+4
source

All Articles