mirror of https://github.com/sbt/sbt.git
[2.x] fix: Fixes console / javaOptions (#9322)
**Problem** console / javaOptions is ignored. **Solution** 1. This enables forked console even for sbt --server mode. 2. This includes console / javaOptions to the forkOptions.
This commit is contained in:
parent
ad6c7a35a8
commit
bb981d7e02
|
|
@ -1121,6 +1121,8 @@ object Defaults extends BuildCommon with DefExtra {
|
|||
Compiler.toConsoleScalacOptions(scalacOptions.value)
|
||||
},
|
||||
console / forkOptions := Def.uncached(Compiler.consoleForkOptions.value),
|
||||
// fork when sbt is launched with --server
|
||||
console / fork := true,
|
||||
collectAnalyses := Definition.collectAnalysesTask.map(_ => ()).value,
|
||||
consoleQuick := consoleQuickTask.value,
|
||||
consoleQuick / scalacOptions := Def.uncached {
|
||||
|
|
|
|||
|
|
@ -616,12 +616,13 @@ object Compiler:
|
|||
}
|
||||
|
||||
def consoleForkOptions: Def.Initialize[Task[ForkOptions]] = Def.task {
|
||||
val jo = (Keys.console / Keys.javaOptions).value.toVector
|
||||
// Build environment variables for proper terminal handling
|
||||
val termEnv = sys.env.get("TERM").getOrElse("xterm-256color")
|
||||
ForkOptions()
|
||||
.withConnectInput(true)
|
||||
.withRunJVMOptions(
|
||||
Vector(
|
||||
jo ++ Vector(
|
||||
s"-Dorg.jline.terminal.type=$termEnv",
|
||||
"-Djline.terminal=auto",
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue