Core

New module editline

The new module editline enhances the prompt, giving type and syntax feedback using e.g. colors. Class names are highlighted blue when typed, indicating that it is known to ROOT. Matching parenthesis pairs are highlighted green when typed, or when the cursor is moved to a bracket. This works for () {} and [] brackets. Any mismatched brackets (those without a matching partner) will be highlighted red when typed or when the cursor is moved to the bracket. Tab completion output is colored magenta to differentiate between tab completion output and user input.

All of the colors are configurable in the .rootrc file. They can be specified as #rgb or #rrggbb or color names: black, red, green, yellow, blue, magenta, cyan or white. They can be followed by an optional bold (alias light) or underlined. Rint.ReverseColor allows to quickly toggle between the default "light on dark" (yes) instead of "dark on light" (no), depending on the terminal background.

An example configuration would be:

Rint.TypeColor:           blue
Rint.BracketColor:        bold green
Rint.BadBracketColor:     underlined red
Rint.TabColor:            magenta
Rint.PromptColor:         black
Rint.ReverseColor:        no

The enhanced prompt is available on all platforms with [n]curses, including Linux, Solaris and MacOS; the bold and underline options are available also for black and white terminals. You can export (or setenv) TERM=xterm-256color for nicer colors.

With editline comes also an improved terminal input handler. It supports e.g. ^O (Ctrl-o) to replay the history: suppose you have entered

...
root [3] i = func()
root [4] i += 12
root [5] printf("i is %d\n", i)

You now want to re-run these three lines. As always, you press the up cursor three times to see

root [6] i = func()

and now press ^O (Ctrl-o) to run the line, and prepare the next line:

root [6] i = func()^O
root [7] i += 12^O
root [8] printf("i is %d\n", i)^O
root [9] 

allowing you to re-run that part of the history without having to press the up-arrow again and again.

Currently, editline is disabled on Windows.