mirror of
https://github.com/sbt/sbt.git
synced 2026-09-07 02:55:23 +02:00
[2.x] fix: Fixes console / javaOptions (#9324)
**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:
@@ -1109,6 +1109,8 @@ object Defaults extends BuildCommon {
|
||||
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 {
|
||||
|
||||
@@ -424,12 +424,13 @@ object Compiler:
|
||||
s"""{ "jsonrpc": "2.0", "method": "$method", "params": $params, "id": $id }"""
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user