# Arrow key problem with mathematica 12 and bash version 5

I want to know if anyone experiences the issue with mathematica-12 with bash-5?

I am using the command line interface of mathematica. Now when I do up arrow or down arrow to go to history, it does not produce the previous commands rather

  ^[[A^[[A^[[B^[[D^[[C^[[A


Now it does not happen with bash-4. Is there any way around?

My mathematica version is:

 Mathematica 12.0.0 Kernel for Linux x86 (64-bit)


Bash version is:

GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)


Of course bash-completion works normally in terminal, only while using mathematica it does not work.

• look for rlwrap with your distro package manager – Fortsaint Nov 21 '19 at 12:04
• @Fortsaint, Well, I have installed that locally and after using rlwrap math I can see that it enables history. However usual math does not. I can of course redefine math=rlwrap math. But any other thoughts apart from this? – Boogeyman Nov 21 '19 at 12:12
• I do not know about Bash 5. I use bash 4..4.20 and Wolfram Engine 12, which include wolframscript. When I run wolframscript from the terminal I do no have that problem you mentioned. Try wolframscript instead of math – Fortsaint Nov 21 '19 at 12:18
• Unfortunately wolframscript also shows same behavior as math. I also checked that it only appears with bash-5, In bash-4 I did not have any problem. – Boogeyman Nov 21 '19 at 12:20
• You can even have autocompletion with rlwrap. Create the following text file Names["*"]~StringRiffle~"\n" // Export["WLNames.txt",#,"Text"]&. Then create your custom version of math that execute rlwrap -f WLNames.txt -pgreen wolframscript -c Dialog[] . This is my custom math with some additional initialization functions github.com/Ludwiggle/math/blob/master/math ` – Fortsaint Nov 21 '19 at 12:32