Syntax highlighting in command line C++ interpreter?

ROOT Version: 6.32.02
Platform: macosxarm64
Compiler: Apple clang version 15.0.0 (clang-1500.3.9.4)


First of all, I want to say I love the Root C++ REPL - even though I’m sure I barely make use of a small fraction of its capabilities!

I was looking at the manual (website followed by /manual/cling - unfortunately as a new user seems I can’t post the link) and noticed the syntax highlighting in the screenshots is a lot more “colorful” than I get when I run it on my system.

On my computer, some types (primitive ones like int, float, or Root’s own) get highlighted, but not anything else.

How can I get more extensive syntax highlighting?

Hello @aky, welcome to the ROOT forum!

The code you’re seeing on the website is not a screenshot but just a text box, so its syntax highlighting comes from the website’s stylesheet, not the ROOT prompt itself.

As far as I know the “basic” syntax highlighting you have on your command line is the only one available and I’m not aware of ways to make it more detailed (but I might be wrong: perhaps @Danilo or others can correct me).

Hi @aky,

We are glad to hear you enjoy Cling and ROOT around it!
Unfortunately I do not think we do not offer full syntax highlighting at the moment. If this is a problem that motivates you, I encourage you to study it and provide a solution: all our code is open source and on GitHub: ROOT · GitHub

Cheers,
D

Aaah, should’ve guessed it was just stylesheet-based highlighting… thanks for the reply and the welcome!

I appreciate the effort the community has put into it!

Not sure if implementing syntax highlighting in the repl is currently within my abilities :sweat_smile: but I guess I might start by studying how ipython and irb (ruby repl) do it.