# Syntax highlighting in command line C++ interpreter?

**URL:** <https://root-forum.cern.ch/t/syntax-highlighting-in-command-line-c-interpreter/60458>\
**Category:** Newbie\
**Created:** [August 9, 2024, 10:27am UTC](https://root-forum.cern.ch/t/syntax-highlighting-in-command-line-c-interpreter/60458 "2024-08-09T10:27:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aky](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/aky/32/37256_2.png) [@aky](https://root-forum.cern.ch/u/aky)\
**Post date:** [August 9, 2024, 10:27am UTC](https://root-forum.cern.ch/t/syntax-highlighting-in-command-line-c-interpreter/60458/1 "2024-08-09T10:27:45Z")

</div>

_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?

---

<div class="post-metadata">

**Author:** ![silverweed](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/silverweed/32/36670_2.png) [@silverweed](https://root-forum.cern.ch/u/silverweed)\
**Post date:** [August 9, 2024, 12:10pm UTC](https://root-forum.cern.ch/t/syntax-highlighting-in-command-line-c-interpreter/60458/2 "2024-08-09T12:10:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [August 9, 2024, 1:26pm UTC](https://root-forum.cern.ch/t/syntax-highlighting-in-command-line-c-interpreter/60458/3 "2024-08-09T13:26:52Z")

</div>

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](https://github.com/root-project/)

Cheers,  
D

---

<div class="post-metadata">

**Author:** ![aky](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/aky/32/37256_2.png) [@aky](https://root-forum.cern.ch/u/aky)\
**Post date:** [August 10, 2024, 7:01am UTC](https://root-forum.cern.ch/t/syntax-highlighting-in-command-line-c-interpreter/60458/4 "2024-08-10T07:01:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aky](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/aky/32/37256_2.png) [@aky](https://root-forum.cern.ch/u/aky)\
**Post date:** [August 10, 2024, 7:03am UTC](https://root-forum.cern.ch/t/syntax-highlighting-in-command-line-c-interpreter/60458/5 "2024-08-10T07:03:51Z")

</div>

I appreciate the effort the community has put into it!

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