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.
I have a function that allows the user to type in a password from the keyboard:
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.