Skip to content

functions that read input from the keyboard don't work with reply in nrepl mode #119

Description

@benwbooth

I have a function that allows the user to type in a password from the keyboard:

(defn read-password [& [prompt]]
  (String. (.readPassword (System/console) "%s"
                          (into-array Object [(or prompt "Enter password: ")]))))

This works fine in the normal clojure command line but not in lein repl. It returns after the first character typed instead of letting me type in the rest of the password and hit Enter. I'm sure this has something to do with the fact that this command is being run on the nrepl server process, but I was wondering if there is some workaround to make this work, at least in cases where the client and server are connected to the same terminal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions