mirror of https://github.com/sbt/sbt.git
Merge pull request #201 from alexarchambault/topic/really-suppress-devtty-message
Really suppress "/dev/tty not configured" message
This commit is contained in:
commit
d8a5e1eedb
|
|
@ -18,7 +18,12 @@ object Terminal {
|
||||||
def consoleDim(s: String): Option[Int] =
|
def consoleDim(s: String): Option[Int] =
|
||||||
if (new File("/dev/tty").exists()) {
|
if (new File("/dev/tty").exists()) {
|
||||||
import sys.process._
|
import sys.process._
|
||||||
Try(Seq("bash", "-c", s"$pathedTput $s 2> /dev/tty").!!.trim.toInt).toOption
|
val nullLog = new ProcessLogger {
|
||||||
|
def out(s: => String): Unit = {}
|
||||||
|
def err(s: => String): Unit = {}
|
||||||
|
def buffer[T](f: => T): T = f
|
||||||
|
}
|
||||||
|
Try(Process(Seq("bash", "-c", s"$pathedTput $s 2> /dev/tty")).!!(nullLog).trim.toInt).toOption
|
||||||
} else
|
} else
|
||||||
None
|
None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue