Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read keyboard input in Scala with the typed characters visible

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?

like image 496
Gigatron Avatar asked Mar 08 '13 23:03

Gigatron


1 Answers

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).

like image 133
KChaloux Avatar answered Oct 12 '22 11:10

KChaloux