Reputation: 347
I am new to Clojure, and I am usually using it from (Spac)emacs, where the repl formats fine. However, when I try to use the repl within a gnome-terminal, then the formatting is broken, i.e. after 'sending' some code, the line of code gets 'reformatted' as shown in the screencast below:
Anybody has some idea what is going on here? The terminal is just a basic 'gnome-terminal' on Fedora.
B.t.w. the same screencast is used for reporting an issue with criterium about the bench
example hanging.
Upvotes: 1
Views: 185
Reputation: 5678
This is a rlwrap
bug that has been fixed upstream (but, as of now, is still open in several distributions) . In a nutshell, either:
rlwrap
(0.46-1 or newer),readline
(8.2 or newer),set enable-bracketed-paste off
in your inputrc
See this bug report on Github (or this summary of the history of this issue)
Hans Lub (rlwrap
maintainer)
Upvotes: 1
Reputation: 37008
Disclaimer: this is not a solution to the problem, but it shows, where the problem lies and what are workarounds.
TL;DR: call clojure
(which does not use rlwrap
¹; use
Rebel-Readline
instead, for more features
clj
calls clojure
, but checks, if rlwrap
is installed and uses
that to call clojure
with some settings, that are suitable for a Lisp.
rlwrap
is a great tool, to get readline
capabilities with
interactive CLI tools, that don't have it (e.g. emacs/vi-mode, history,
"hippy" completion). But in this case it is the culprit to smash up the
REPL. What's underlying problem is not clear, but in cases like this
the options usually are: buggy software (the terminal, rlwrap
, or the
way Clojure interacts with the terminal), wrong/buggy TERM
settings or
term-capabilities.
That said, rlwrap
might be the "just good enough" option here
anyway. First of all Clojure developers tend to use the REPL via the
editor anyway. Second there is a far superior option to get what
rlwrap
brings to the table:
Rebel-Readline
Beside emacs/vi-modes and history it brings (and probably more):
¹) From: https://github.com/hanslub42/rlwrap
rlwrap is a 'readline wrapper', a small utility that uses the GNU Readline library to allow the editing of keyboard input for any command.
Upvotes: 3