Make ConsoleReader creation lazy

I noticed while debugging a jline 2 issue that the SimpleReader was
creating a ConsoleReader on startup even if it was never used.
This commit is contained in:
Ethan Atkins 2020-09-29 09:57:28 -07:00
parent 57af6ba9b7
commit 2ccc0714e8
1 changed files with 1 additions and 1 deletions

View File

@ -316,7 +316,7 @@ class SimpleReader private[sbt] (
) extends JLine {
def this(historyPath: Option[File], handleCONT: Boolean, injectThreadSleep: Boolean) =
this(historyPath, handleCONT, Terminal.console)
protected[this] val reader: ConsoleReader =
protected[this] lazy val reader: ConsoleReader =
LineReader.createJLine2Reader(historyPath, terminal)
}