Share your thoughts in the 2025 State of Clojure Survey!

Welcome! Please see the About page for a little more info on how this works.

0 votes
ago in REPL by

Hello,

I'm having a small bug with the Clojure REPL - when I enter a command, after pressing the enter key, the command gets displayed incorrectly - basically the beginning of the text of the command that I entered is displayed for the first few characters, and then everything after that is overwritten with the same text of the command displayed with an indentation.

Not sure if that's very clear, so I've added a pair of screenshots, "before and after", to illustrate.

This issue seems similar to this older question, although in that case the issue was with the rlwrap library, which was patched afterwards.

Is there a way to fix this?

2 Answers

0 votes
ago by

I assume you are actually typing "(map inc [1 2 3])" and the rest is incorrect display?

Can you provide the results of:

java -version
clj --version
rlwrap -v

and your operating system and version?

ago by
Hello, thanks for your reply :)

Yes, you assume correctly, the first line should read `(map inc [1 2 3[)`.

`java -version` returns
`
openjdk version "24.0.2" 2025-07-15
OpenJDK Runtime Environment (build 24.0.2+12-2)
OpenJDK 64-Bit Server VM (build 24.0.2+12-2, mixed mode, sharing)
`
`clj --version` returns `Clojure CLI version 1.12.0.1488`, and `rlwrap -v` returns `rlwrap 0.45.2`.

My operating system is FreeBSD 14.3, more precisely, `uname -a` returns
`FreeBSD t480s 14.3-RELEASE FreeBSD 14.3-RELEASE releng/14.3-n271432-8c9ce319fef7 GENERIC amd64`.
ago by
Also, do you have a ~/.inputrc and if so what’s in it?
ago by
My first guess would be to update rlwrap, as that's really what's controlling that echo'ing.
ago by
I do not have an ~/.inputrc file.

The version of rlwrap I have installed is the most recent version available in the `pkg` package manager.

I'll try building/installing rlwrap from source, see if that helps :)
ago by
Updating rlwrap did indeed fix the issue, thank you very much for your kindness and help with this issue, I hope you have a lovely day, and happy holidays! ^_^
0 votes
ago by

Updating the version of rlwrap by building it from source fixed the issue.

The version installed on my FreeBSD system was 0.45, the latest version available for the package manager, building from source yielded version 0.48, which seems to have fixed the display bug :)

...