line-seq and read-line don't return nil on Ctrl-D in lein repl


Executing in lein repl either

(doseq [line (line-seq ( in)) :while line]
(println line))


(doseq [line (read-line) :while line]
(println line))

One would expect these to return on a user's enter of Ctrl-D, however they never return.


OSX, lein repl


Andy Fingerhut
August 25, 2014, 5:42 PM

Geoff, it looks like there have been recent changes committed to the tools.nrepl library related to this issue. tools.nrepl is used within Leiningen to implements its REPL.

Alex Miller
August 22, 2014, 2:29 PM

Agreed with Andy - these examples work fine in base repl but other environments may be affecting your input upstream of clojure.

Andy Fingerhut
August 22, 2014, 5:51 AM

If instead of 'lein repl' you run:

at a shell prompt, you get a REPL where the first doseq expression you give does return when you enter Ctrl-D.

The second doseq expression returns a string from (read-line), and then the doseq iterates over that as a sequence of characters, and it returns without needing Ctrl-D after reading a single line in both 'lein repl' and the plain Clojure REPL with the command given above.

I suggest that the behavior with your first doseq expression is an issue to be taken up with the Leiningen developers. Several ways of contacting them are given at I would recommend IRC or the email list first, before creating a Github issue.

Not Reproducible
Your pinned fields
Click on the next to a field label to start pinning.








Affects versions