Read keyboard input in Scala with the typed characters visible

console, scala, user-input

Solution

I'm surprised this hasn't been answered yet. I ran into the same problem awhile back. Try running the REPL like this:

C:\> scala -Xnojline

This should disable JLine and allow you to use the `readLine` method the way you would expect (displaying characters typed as you type them).

Problem

I know about `readInt` and `readLine` similar methods for reading input from the keyboard and am able to populate variables with the data typed by the user. But in the REPL nothing is displayed when the characters are being typed. Is there a setting in the REPL to make them visible? Or should I use some other way of reading input from the user?

Original source