Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt corrupts terminal display

This is a head scratcher for me; I'm on Mac OS 10.11.6 and I recently started using sbt for scala. I'm running into the situation that every time I run an sbt command (e.g., sbt run, sbt test, etc.) for a specific small Hello World type project (included at the bottom of this post), I lose the ability to see my keyboard strokes afterwards. My standard prompt is still there, but anything I type doesn't show up. The keystrokes are still registered, in that I can type ls, hit ENTER and still see the output, but I can't see that I typed ls.

Perhaps even more perplexing is that if I run sbt and enter interactive mode, I can see my keystrokes! Similarly, I can see my keystrokes in both the scala REPL and an IPython session. However, I can't see my keystrokes in the standard python interpreter!

It doesn't appear to be an issue with my $PS1, as I can unset PS1 and the issue is the same. It also doesn't seem to occur for other projects.

The directory structure is the standard sbt structure, and this is in src/main/scala/Hello.scala:

object Hello extends App {                                                         
    val p = Person("Foo")                                              
    println("Hello from " + p.name)                                                
}                                                                                  

case class Person(var name: String) 

Is it possible that when I copy / pasted this into vim (from a .pdf if that's relevant), some bizarre character got hidden in there? Otherwise, what's going on with this?

like image 793
chriswhite Avatar asked Oct 30 '22 02:10

chriswhite


1 Answers

From Eric K Richardson at the sbt gitter channel:

This is fixed now and should be in 1.0.2 - https://github.com/sbt/sbt/pull/3507/commits/b6a3ca19373c2ffa17c5660fa74a9a4204948b6e
You can type stty echo to restore window or use - https://github.com/paulp/sbt-extras
like image 118
marios Avatar answered Nov 15 '22 05:11

marios