Patch for unidoc

This commit is contained in:
Eugene Yokota 2021-03-08 22:41:19 -05:00
parent 571005efa0
commit d0f540aea1
2 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ import sbt.util.Logger
import sbt.ConcurrentRestrictions.Tag
import sbt.protocol.testing._
import sbt.internal.util.Util.{ AnyOps, none }
import sbt.internal.util.{ RunningProcesses, Terminal }
import sbt.internal.util.{ RunningProcesses, Terminal => UTerminal }
private[sbt] object ForkTests {
def apply(
@ -97,7 +97,7 @@ private[sbt] object ForkTests {
val is = new ObjectInputStream(socket.getInputStream)
try {
val config = new ForkConfiguration(Terminal.isAnsiSupported, parallel)
val config = new ForkConfiguration(UTerminal.isAnsiSupported, parallel)
os.writeObject(config)
val taskdefs = opts.tests.map { t =>

View File

@ -10,13 +10,13 @@ package sbt
import java.util.regex.Pattern
import scala.Console.{ BOLD, RESET }
import sbt.internal.util.Terminal
import sbt.internal.util.{ Terminal => UTerminal }
object Highlight {
def showMatches(pattern: Pattern)(line: String): Option[String] = {
val matcher = pattern.matcher(line)
if (Terminal.isColorEnabled) {
if (UTerminal.isColorEnabled) {
// ANSI codes like \033[39m (normal text color) don't work on Windows
val highlighted = matcher.replaceAll(scala.Console.RED + "$0" + RESET)
if (highlighted == line) None else Some(highlighted)
@ -26,5 +26,5 @@ object Highlight {
None
}
def bold(s: String) =
if (Terminal.isColorEnabled) BOLD + s.replace(RESET, RESET + BOLD) + RESET else s
if (UTerminal.isColorEnabled) BOLD + s.replace(RESET, RESET + BOLD) + RESET else s
}