Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pressing arrow keys do not work correctly in Clojure console

Tags:

clojure

I downloaded the Clojure jar. Its version is 1.6.0. When I run Clojure in console I press arrow keys but they don't move the cursor but produce these characters "[[D^[[C.

I start Clojure using this command:

java -cp clojure-1.6.0.jar clojure.main

using Java 1.7.0_55 64 bit on Ubuntu 14.04 LTS 64 bit.

How can I get back normal arrow keys behaviour ?

like image 567
michalskuza Avatar asked May 29 '14 21:05

michalskuza


People also ask

Why are my arrow buttons not working?

Turn off Scroll Lock on your keyboard Most of the time, if your arrow keys aren't moving the cursor from cell to cell, the fix is as simple as disabling the Scroll Lock key on your keyboard.

How do you unlock the arrow keys on a keyboard?

Windows - Turn off the Scroll Lock feature by pressing the Shift-Scroll Lock (ScrLk) keys. Alternately, use the On-Screen Keyboard and click the ScrLk button in the lower right. Click Start or tap the Windows key and type osk then click <enter> to open the On-Screen Keyboard.


2 Answers

The repl bundled with Clojure is pretty terrible. But that's okay, because you want to install Leiningen anyway, and its repl is much better, including the various readline stuff you're used to.

But in general, if there's some app that does a terrible job of being a repl, you can always use rlwrap to wrap the app in readline.

like image 105
amalloy Avatar answered Sep 20 '22 15:09

amalloy


You are following hopelessly outdated instructions/tutorials. The generally accepted way to interact with all things clojure is through Leiningen. Then start Clojure by running:

lein repl

You can create a new web project by running:

lein new compojure my-project-name

or a new general project by running:

lein new my-project-name
like image 27
Arthur Ulfeldt Avatar answered Sep 18 '22 15:09

Arthur Ulfeldt