mirror of https://github.com/sbt/sbt.git
ensure enableEcho called after jline.Terminal.getTerminal. fixes #460
This commit is contained in:
parent
e5bedb3e14
commit
eec347e2dd
|
|
@ -53,8 +53,9 @@ abstract class JLine extends LineReader
|
|||
}
|
||||
private object JLine
|
||||
{
|
||||
def terminal = jline.Terminal.getTerminal
|
||||
def resetTerminal() = withTerminal { _ => jline.Terminal.resetTerminal }
|
||||
// When calling this, ensure that enableEcho has been or will be called.
|
||||
// getTerminal will initialize the terminal to disable echo.
|
||||
private def terminal = jline.Terminal.getTerminal
|
||||
private def withTerminal[T](f: jline.Terminal => T): T =
|
||||
synchronized
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,8 +35,13 @@ object ConsoleLogger
|
|||
}
|
||||
|
||||
private[this] def ansiSupported =
|
||||
try { jline.Terminal.getTerminal.isANSISupported }
|
||||
catch { case e: Exception => !isWindows }
|
||||
try {
|
||||
val terminal = jline.Terminal.getTerminal
|
||||
terminal.enableEcho() // #460
|
||||
terminal.isANSISupported
|
||||
} catch {
|
||||
case e: Exception => !isWindows
|
||||
}
|
||||
|
||||
private[this] def os = System.getProperty("os.name")
|
||||
private[this] def isWindows = os.toLowerCase.indexOf("windows") >= 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue