Skip to content

Commit

Permalink
Make the launcher initialize Jansi if it's found on the path
Browse files Browse the repository at this point in the history
  • Loading branch information
szeiger committed Jan 11, 2012
1 parent 1e47d72 commit a8d34be
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions launch/Boot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ object Boot
{
System.clearProperty("scala.home") // avoid errors from mixing Scala versions in the same JVM
CheckProxy()
initJansi()
run(args)
}
// this arrangement is because Scala 2.7.7 does not properly optimize away
Expand Down Expand Up @@ -40,4 +41,16 @@ object Boot
}
private def exit(code: Int): Nothing =
System.exit(code).asInstanceOf[Nothing]

private def initJansi() {
try {
val c = Class.forName("org.fusesource.jansi.AnsiConsole")
c.getMethod("systemInstall").invoke(null)
if(System.getProperty("sbt.log.format") eq null)
System.setProperty("sbt.log.format", "true")
} catch {
case ignore: ClassNotFoundException =>
case ex => println("Jansi found on class path but initialization failed: "+ex)
}
}
}

0 comments on commit a8d34be

Please sign in to comment.