Re: [sbt] Console input broken in sbt run

305 views
Skip to first unread message

Tony Sloane

unread,
Oct 29, 2012, 4:52:18 PM10/29/12
to simple-b...@googlegroups.com
On 30/10/2012, at 4:52 AM, Clayton Wohl <clayt...@gmail.com> wrote:

java.io.Console.readLine() and java.io.Console.readPassword() don't work correctly within sbt. They only let me type a single character.

if I build in sbt and then run via

scala -cp path/output.jar org.test.Main

the same code works and allows the user to enter a full line of text and hit enter before proceeding.

Also, scala.Console.readLine() works perfectly in sbt. However, there is no readPassword() equivalent.

I have had cases where the use of jline in my program and its use in sbt have clashed, leading to similar problems with reading input, mostly echo not being treated properly. Perhaps your problem is similar.

One thing that helped me was forking runs. (The other was making sure that I used the same jline version as sbt.) See this page for things you could try:


cheers,
Tony

Reply all
Reply to author
Forward
0 new messages