Is there a colored REPL for Clojure?

后端 未结 11 709
孤城傲影
孤城傲影 2020-12-23 14:09

I\'d like to get a colored REPL for clojure code, similar to what you can do with IRB for Ruby.

Are there any libraries or settings for user.clj that provide automati

11条回答
  •  粉色の甜心
    2020-12-23 14:54

    If you just want to color the prompt and you are using Leiningen (which you should), you can use :repl-options and ANSI escape sequences:

    :repl-options {:prompt (fn [ns]
                             (str "\033[1;32m"
                                  ns "=>"
                                  "\033[0m "))}
    

    References:

    • GitHub – technomancy/leiningen – sample.project.clj
    • roguejs.com – “Console colors in node.js”, posted 2011

提交回复
热议问题