Change the color of the text in the Common Lisp RE

2019-05-07 11:07发布

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

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

Is there any way this can be done? I use SBCL and my repl is inside emacs. Thanks!

1条回答
啃猪蹄的小仙女
2楼-- · 2019-05-07 11:25

You can use ANSI escape code to print colorful texts:

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

I'm not sure whether this works in slime, although.

查看更多
登录 后发表回答