up arrow works in math version 9, fails in math version 8 ^[[A


I have strange up-arrow behavior on command line Mathematica 8 versus Mathematica 9. Version 9 gives me history, where version 8 fails with escape codes. Any way to make them both work on the same system?

ubuntu@ip-10-45-11-134:~$ math
Mathematica 9.0 for Linux x86 (64-bit)
Copyright 1988-2013 Wolfram Research, Inc.

In[1]:= $KernelCount                                                                                                                                                               
    Out[1]= 0
    In[2]:= $KernelCount                                                                                                                                               
Out[2]= 0
In[3]:= ubuntu@ip-10-45-11-134:~$ math8                                                                                                                                            

Mathematica 8.0 for Linux x86 (64-bit)
Copyright 1988-2011 Wolfram Research, Inc.
In[1]:= $KernelCount
    Out[1]= 0
    In[2]:= ^[[A


Posted 2013-12-05T21:31:58.600

Reputation: 131

Question was closed 2013-12-06T06:55:47.893

2I confirm this behavior. In V6 up arrow also don't work. I think this is a feature of the V9. – ybeltukov – 2013-12-05T21:47:04.060


@ybeltukov is right. This is a new feature in version 9, so there is no way to make version 8 behave in exactly the same way. However, one can obtain a reasonable approximation: (11193)

– Oleksandr R. – 2013-12-05T21:50:25.487

After more googling, there is a package called rlwrap that does the trick!

You can on ubuntu:

apt-get install rlwrap

Then up-arrow behaves correctly on Ubuntu precise 13.04, at least:

ubuntu@ip-10-45-11-134:~$ rlwrap math8
 – bfschott  – 2013-12-05T21:59:43.960

@bfschott Good catch! On Gentoo it also works fine. Could you post it as an answer? I will be possible to +1 you :) – ybeltukov – 2013-12-05T23:07:15.603


@ybeltukov You might want to read my answer here where I showed this. In the same post, librik (working for Wolfram) explained that in version 9 they have linked the readline into the console math which makes that it works.

– halirutan – 2013-12-06T00:59:07.020

@halirutan Thanks! I've read your post a long time ago and totally forget it. – ybeltukov – 2013-12-06T01:03:53.660

The answer might be a duplicate, but I think the original question is poorly phrased and hard to find. "How do I efficiently navigate the command line interface in Mathematica" is hardly an indication that it will answer my question. – bfschott – 2013-12-07T01:56:23.153

No answers