mirror of https://github.com/sbt/sbt.git
Make the launcher initialize Jansi if it's found on the path
This commit is contained in:
parent
710b12520d
commit
602e5e2f27
|
|
@ -16,6 +16,7 @@ object Boot
|
||||||
case _ =>
|
case _ =>
|
||||||
System.clearProperty("scala.home") // avoid errors from mixing Scala versions in the same JVM
|
System.clearProperty("scala.home") // avoid errors from mixing Scala versions in the same JVM
|
||||||
CheckProxy()
|
CheckProxy()
|
||||||
|
initJansi()
|
||||||
run(args)
|
run(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -45,4 +46,16 @@ object Boot
|
||||||
}
|
}
|
||||||
private def exit(code: Int): Nothing =
|
private def exit(code: Int): Nothing =
|
||||||
System.exit(code).asInstanceOf[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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue