mirror of https://github.com/sbt/sbt.git
Fix console echo for windows batch commands
For reasons I don't fully understand, it is necessary to go in and out of raw mode to get console input to echo on windows. This was reported as sbt new not echoing input in #5952.
This commit is contained in:
parent
7a3ca0d9c2
commit
46c5f8b0d8
|
|
@ -796,6 +796,12 @@ object Terminal {
|
|||
private[util] val system: org.jline.terminal.Terminal,
|
||||
) extends TerminalImpl(in, out, originalErr, "console0") {
|
||||
private[this] val rawMode = new AtomicBoolean(false)
|
||||
if (Util.isWindows && hasConsole) {
|
||||
// It is necessary to enter and exit raw mode in order to get the windows
|
||||
// console to echo input.
|
||||
enterRawMode()
|
||||
exitRawMode()
|
||||
}
|
||||
override private[sbt] def getSizeImpl: (Int, Int) = {
|
||||
val size = system.getSize
|
||||
(size.getColumns, size.getRows)
|
||||
|
|
|
|||
Loading…
Reference in New Issue