Bug#576814: libjline-java: left-arrow, up-arrow adds null to retrieved history line
Package: libjline-java Version: 0.9.94-5 Severity: normal In xterm, gnome-terminal, lxterminal, and presumably other X terminals as well, and even linux console, some sequences of left-arrow and up-arrow key-presses corrupt lines from the history by adding nulls and dropping characters earlier in the line. This hampers effective use of the command-line history in every language interpreter I have tried that uses jline, and is a source of frustration in using these programs to experiment with the languages. I have reproduced the problem in bsh, jirb and clojure repl, the latter invoked as: $ java -cp /usr/share/java/clojure.jar:/usr/share/java/jline.jar jline.ConsoleRunner clojure.main Using clojure repl, the following steps are sufficient to reproduce the problem and demonstrate that the corruption is accompanied by the addition of a null character. 1.Enter these lines: (println hello world) (println hello) 2. press up-arrow, left-arrow, up-arrow, and the line now looks like this: user= (println hell world) 3. press enter on this line, resulting in the following: hell world nil java.lang.Exception: Unable to resolve symbol: in this context (NO_SOURCE_FILE:0) 4. ^D to exit and hexdump -C ~/.jline-clojure.main.history produces: 28 70 72 69 6e 74 6c 6e 20 22 68 65 6c 6c 6f 20 |(println hello | 0010 77 6f 72 6c 64 22 29 0a 28 70 72 69 6e 74 6c 6e |world).(println| 0020 20 22 68 65 6c 6c 6f 22 29 0a 28 70 72 69 6e 74 | hello).(print| 0030 6c 6e 20 22 68 65 6c 6c 20 77 6f 72 6c 64 22 29 |ln hell world)| 0040 00 0a |..| 0042 Notice the single null at the end of the third line before the newline character. This accounts both for the Unable to resolve symbol: in this context error message (the null is the symbol you can't see in this message) and for the fact that a single character is dropped in hell world (though why it is the 'o' and not some other character is mysterious). In bsh and jirb the corruption is exactly the same. bsh version: bsh % print(hello world); hello world bsh % print(hello); hello bsh % print(hell world); hell world jirb version: puts hello world hello world = nil puts hello hello = nil puts hell world hell world = nil I have experimented with different language settings, (LANG=C, =en_US.UTF-8,) different terminal emulators, (as indicated in my summary above,) and different values of TERM, (screen, xterm, dumb.) Nothing helps. Thanks, Ben -- System Information: Debian Release: squeeze/sid APT prefers testing APT policy: (900, 'testing'), (800, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.32-trunk-686 (SMP w/2 CPU cores) Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/bash Versions of packages libjline-java depends on: ii default-jre-headless [java2-r 1.6-34 Standard Java or Java compatible R ii openjdk-6-jre-headless [java2 6b17-1.7-1 OpenJDK Java runtime, using Hotspo libjline-java recommends no packages. Versions of packages libjline-java suggests: pn libjline-java-doc none (no description available) -- no debconf information __ This is the maintainer address of Debian's Java team http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers. Please use debian-j...@lists.debian.org for discussions and questions.
Bug#576814: Workaround with rlwrap (Re: left-arrow, up-arrow adds null to retrieved history line)
Package: libjline-java Version: 0.9.94-5 Severity: normal On #clojure @ irc.freenode.net, a helpful respondent reviewing this bug suggested I use rlwrap as a workaround. This works for me, and adds some more features a like that actually make it preferable to jline, such as reverse-incremental-search and paren flashing, so: rlwrap java -cp /usr/share/java/clojure.jar clojure.main Repeating my test case from before, the hello world line is properly displayed. Ben __ This is the maintainer address of Debian's Java team http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers. Please use debian-j...@lists.debian.org for discussions and questions.
Bug#572432: REPL does not use JLine ConsoleRunner or another readline-style library
Package: clojure Version: 1.1.0+dfsg-1 Severity: normal Consider recommending (or suggesting) rlwrap instead, as jline has a rather annoying line-corruption bug I discovered (see #576814) that limits its usefulness, and rlwrap is more featureful. Example invocation: rlwrap java -cp /usr/share/java/clojure.jar clojure.main Supports saved history, reverse-incremental-search, paren flashing, and I am told, even tab-completion that can learn from the expressions you type ... All around a much more featureful solution as well as being less buggy. Ben __ This is the maintainer address of Debian's Java team http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers. Please use debian-j...@lists.debian.org for discussions and questions.
Bug#572343: clojure-repl: clojure.lang.Repl is deprecated
Package: clojure Version: 1.1.0+dfsg-1 Severity: normal Tags: patch When I start clojure-repl, it displays a deprecation warning: sy...@lear:~$ clojure-repl WARNING: clojure.lang.Repl is deprecated. Instead, use clojure.main like this: java -cp clojure.jar clojure.main -i init.clj -r args... Clojure 1.1.0 user= By following the advice in the warning, the warning can be eliminated: sy...@lear:~$ ~/bin/clojure-repl Clojure 1.1.0 user= sy...@lear:~$ diff -u /usr/bin/clojure-repl ~/bin/clojure-repl --- /usr/bin/clojure-repl 2010-02-01 22:11:55.0 -0400 +++ /u12/home/synrg/bin/clojure-repl2010-03-03 10:34:19.0 -0400 @@ -19,4 +19,4 @@ esac done -exec java -cp /usr/share/java/clojure.jar$extra_classpath clojure.lang.Repl $@ +exec java -cp /usr/share/java/clojure.jar$extra_classpath clojure.main $@ -- System Information: Debian Release: squeeze/sid APT prefers testing APT policy: (900, 'testing'), (800, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.32-trunk-686 (SMP w/2 CPU cores) Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/bash Versions of packages clojure depends on: ii libasm3-java 3.2-3 Java bytecode manipulation framewo ii openjdk-6-jre [java2-runtime] 6b17-1.7-1 OpenJDK Java runtime, using Hotspo clojure recommends no packages. clojure suggests no packages. -- no debconf information ___ pkg-java-maintainers mailing list pkg-java-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers