I've discovered some interesting behaviour - not necessarily a bug, and (if it is a bug) not necessarily a bug in Clojure.
Essentially, to emulate a 1970s user interface, I want to read single key strokes from the console. I've found two recipes online, both using the JLine java package:
One of these recipes uses Terminal.getTerminal(), the other uses new ConsoleReader(). What happens in my context (Debian on 64 bit Intel) is that as soon as an instance of either class is instantiated, echoing to the console ceases. If you do (obviously, with the jline jar on the classpath):
(import 'jline.Terminal)
(def term (Terminal/getTerminal))
(.initializeTerminal term)
(.enableEcho term)
(or the equivalent things with a ConsoleReader), every keystroke is echoed twice. But if you do
user=> ((..ddiissaabblleeEEcchhoo tteerrmm))
^Jnil
one single further character gets echoed and then nothing more, unless you type (blindly) (.enableEcho term), when the double-echoing behaviour resumes. This is consistent - on my Debian box - with Clojure 1.2, Clojure 1.3, and Clojure 1.5.1, all using jline 1.0. I haven't yet compiled up a little Java app to find out what happens without Clojure, and I haven't tried compiling a little command-line Clojure app, because I want to be able to read single characters in the context of the REPL, so if, as I hypothesise, jline is fighting with the REPL, proving whether it works outwith the context of the REPL doesn't really help me.
Has anyone else seen this behaviour? Is there any solution?