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