On 21.04, the REPL user prompt disappears after execution

Bug #1930277 reported by Max Sokolovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
clojure (Ubuntu)
Confirmed
Undecided
Elana Hashman

Bug Description

This is found under 21.04, even in a Docker container built from a 21.04 image. No such issues under 20.04.
The REPL (started with the `clojure` command) just echoes the result of an expression before printing it, so it prints it twice.

Revision history for this message
Elana Hashman (ehashman) wrote :

20.04 has 1.10.1, 21.04 is the first version with 1.10.2. Was 20.10 affected?

Can you please include the output and some more info about your system? I know there were also some readline changes that happened recently-ish (e.g. in Debian bullseye, Fedora 34).

Revision history for this message
Elana Hashman (ehashman) wrote :

I cannot reproduce on Debian bullseye so I assume this is Ubuntu-specific:

ehashman@fedora:~$ clojure
Clojure 1.10.2
(map + [1 2 3])
(1 2 3)
(println "hello world")
hello world
nil
user=>
ehashman@fedora:~$ apt show clojure
Package: clojure
Version: 1.10.2-1
Priority: optional
...
ehashman@fedora:~$ cat /etc/debian_version
11.0

Revision history for this message
Max Sokolovsky (genexpr) wrote :

The prompt is replaced with the expression. Upon hitting Enter, first the expression itself gets printed, then the value.

(+ 1 2)
3

1
1
2
2
3
3
user=>

Notice how the prompt is missing after all REPL evaluations, except the most recent one.

Revision history for this message
Max Sokolovsky (genexpr) wrote :

This is not happening on 20.10, so this behavior is new.

Revision history for this message
Elana Hashman (ehashman) wrote :

Retitled bug to better describe the problem and confirmed that this also affects Debian upstream.

Does not affect a REPL launched on Clojure 1.10.2 with Leiningen.

Leiningen appears to launch a 1.10.1 REPL by default.

This appears to be entirely cosmetic so I'm not sure will be fixed in bullseye (has no effect on Clojure core functionality and we are frozen). Thanks for the report.

summary: - On 21.04, the REPL prints all values twice.
+ On 21.04, the REPL user prompt disappears after execution
Changed in clojure (Ubuntu):
assignee: nobody → Elana Hashman (ehashman)
status: New → Confirmed
Revision history for this message
Elana Hashman (ehashman) wrote :

Okay, it's an issue with the rlwrap script.

System clojure (Debian bullseye):

ehashman@fedora:/tmp/app$ clojure
Clojure 1.10.2
(map inc [0 1 2])
(1 2 3)
user=>

With a copy of the Clojure CLI wrapper script set to use upstream Clojure binaries instead of the system ones:

ehashman@fedora:/tmp/app$ ./clojure
Clojure 1.10.2
(map inc [0 1 2])
(1 2 3)
user=>

Running those upstream ones directly with java:

ehashman@fedora:/tmp/app$ java -cp /home/ehashman/.m2/repository/org/clojure/clojure/1.10.2/clojure-1.10.2.jar:/home/ehashman/.m2/repository/org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.jar:/home/ehashman/.m2/repository/org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar"$extra_classpath" clojure.main
Clojure 1.10.2
user=> (map inc [0 1 2])
(1 2 3)
user=>

Running Debian's jar directly:

ehashman@fedora:/tmp/app$ java -cp /usr/share/java/clojure.jar clojure.main
Clojure 1.10.2
user=> (map inc [0 1 2])
(1 2 3)
user=>

Revision history for this message
Elana Hashman (ehashman) wrote :

https://ask.clojure.org/index.php/10025/have-prompts-previous-lines-command-started-disappearing

It's a bug in readline and is affecting clj as well. Won't get fixed until rlwrap 0.44 is available. The readline changes for bracketed paste have thrown a bunch of people, but I didn't think it would affect Clojure too :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.