Better History?

Hi, I am used to the IPython interpreter’s history where you can press the up arrow key to recall recent commands. One of my favourite things is if you partially type a command and press the up arrow key, it only recalls commands that started with what you typed. Here is an example:

In [1]: a = 5
In [2]: q = 3
In [3]: a 

if you press up-arrow here, you get a = 5. If you delete the a and press up-arrow, you get q = 3. The history also persists from session to session, so in a new IPython interpreter I sometimes find it convenient to type import and press the up-arrow to recall my previously imported modules (typically ROOT,os, followed by ROOT.gROOT.Macro( os.path.expanduser( ‘~/macros/rootlogon.C’ ) )).

Is there a way to implement this kind of history in the ROOT interpreter? IPython uses GNU readline, which is apparently a non-trivial thing to have as a dependency, so maybe it could be included in a variant/optional setting?


Try to press Ctrl-R then type “import” and you should get the most recent “import”, then you can again press Ctrl-R to get any previous appearances of “import”.