更改Common Lisp REPL中文本的颜色 [英] Change the color of the text in the Common Lisp REPL

查看:279
本文介绍了更改Common Lisp REPL中文本的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想控制Common Lisp中显示的文本的颜色。
类似这个伪代码:

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"))

有什么办法吗?我使用SBCL和我的repl是在emacs内。
谢谢!

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

推荐答案

您可以使用 ANSI转义代码打印多彩文本:

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.

这篇关于更改Common Lisp REPL中文本的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆