1

I'm installed Rakudo on Ubuntu 21.10 by running this command:

sudo apt install rakudo

Now I can run the Raku REPL by running raku or rakudo.

I would like to be able to select the previous command by typing the up arrow, just like you can in the Python on Node REPL, for instance. Instead, this is what happens when I press the arrow key:

$ raku
> say "hello";
hello
> ^[[A

How do I make the up arrow work?

Flimm
  • 44,031

1 Answers1

2

The answer is contained in the output of Rakudo when you run it:

$ rakudo
Welcome to ™ v2020.12.
Implementing the ™ programming language v6.d.
Built on MoarVM version 2020.12.

You may want to zef install Readline or zef install Linenoise or use rlwrap for a line editor

To exit type 'exit' or '^D' >

That is, we need to run zef install Readline. From the command-line, make sure that zef is installed by running:

sudo apt install perl6-zef

Then install the Raku module named Readline by running:

zef install Readline

If you get test failures, you may need to run this:

zef install Readline --force-test

Now when you run raku or rakudo, you will get the expected behaviour when pressing up arrow, which the library Readline enables.

Flimm
  • 44,031