Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
benwbooth opened this issue Jul 14, 2013 · 1 comment
Labels

Comments

@benwbooth
Copy link

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.

@trptcolin
Copy link
Owner

Hmm, yeah, seems like it's got to be something specific to REPLy's nREPL implementation, nREPL itself, because it works when I use the non-nREPL mode... I don't know much about System.console, unfortunately - not sure how to work around this. Ideas welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants