sbt, the interactive build tool
Go to file
Brian Hotopp 0c03718218 [1.x] fix: Pump forked stdout/stderr to the captured active terminal (#9185)
Since #8678 (sbt 1.12.2), Fork.apply has routed the
`connectInput && outputStrategy == StdoutOutput` case through a new
JProcess path that calls `jpb.inheritIO()`. `inheritIO` ties the child
JVM's stdio to the sbt server JVM's OS-level fd 1/2, bypassing the
`Terminal` indirection. In server mode (which `sbt --client` uses),
that indirection is how task output reaches the client terminal — so
the child's stdout/stderr went nowhere observable to the client.

Keep `redirectInput(Redirect.INHERIT)` so REPL/raw-mode keystrokes
still reach the child (preserving the use case #8678 added), but
leave stdout/stderr as PIPE and pump them to the active terminal's
output/error streams in two daemon threads. The pump threads are
joined after `p.waitFor()` so all buffered output drains before the
task completes.

The active terminal is captured once on the task thread rather than
re-resolved per-write via the `System.out`/`err` proxies, otherwise a
concurrent terminal swap can route mid-pump bytes to the wrong client
(observed on the CI JDK 8 matrix; the proxy's `activeTerminal.get()`
is evaluated at every write).

Forced scala/scala3 CI to downgrade from sbt 1.12.10 to 1.12.1 (see
scala/scala3#25995).

Diagnosis credit: @mbovel in #9185.

Fixes sbt/sbt#9185.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 10:16:54 -04:00
.github [1.x] change branch for dependency submission to 1.12.x (#9088) 2026-04-13 18:29:52 -04:00
client Bye jansi 2024-11-07 18:46:04 -08:00
core-macros/src/main/scala/sbt/internal/util/appmacro Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
dependency-tree/src/main/scala/sbt/plugins Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
internal [1.x] log4j 2.25.3 (#8872) 2026-03-04 01:36:53 -05:00
launch Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
launcher-package [1.x] Bump sbtn to 2.0.0-RC13 (#9139) 2026-04-27 01:01:00 -04:00
licenses move remaining pieces of sbt subproject to sbt_pending and fix notices 2010-09-21 21:55:50 -04:00
main [1.x] Add Test configuration to evictionWarningOptions (#9102) 2026-04-24 03:25:47 -04:00
main-actions/src [1.x] Fix #9190: avoid leaving partial jar after interrupted package (#9196) 2026-05-07 01:23:36 -04:00
main-command/src Improve sbtn a bit 2025-08-24 03:58:13 -04:00
main-settings/src Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
notes fix typo 2023-06-24 20:05:52 +09:00
project [1.x] Fix #9190: avoid leaving partial jar after interrupted package (#9196) 2026-05-07 01:23:36 -04:00
protocol/src/main fix: Use JDK path, not JRE path 2025-03-03 02:31:44 -05:00
run [1.x] fix: Pump forked stdout/stderr to the captured active terminal (#9185) 2026-05-25 10:16:54 -04:00
sbt-app/src [1.x] Bump to lm 1.12.2 (#9167) 2026-05-02 15:09:57 -04:00
scripted-plugin/src/main/scala/sbt Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
scripted-sbt-old/src/main/scala/sbt/test Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
scripted-sbt-redux Keep the close method 2023-07-23 01:01:23 -04:00
server-test/src [1.x] fix: Pump forked stdout/stderr to the captured active terminal (#9185) 2026-05-25 10:16:54 -04:00
src/main/conscript sbt 1.3.0 2019-09-04 01:24:08 -04:00
tasks fix scaladoc warnings 2023-06-25 08:04:17 +09:00
tasks-standard some trivial refactoring 2023-06-25 08:57:41 +09:00
testing Bump IO, ipc-socket, and launcher 2024-10-18 02:26:58 -04:00
util-cache Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
util-tracking Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
zinc-lm-integration/src [1.x] Respect `scalaOrganization` in compiler bridge resolution (#8732) (#8799) 2026-02-23 03:12:46 -05:00
.gitattributes Fix line endings in msi 2021-11-19 20:41:39 -05:00
.gitignore Bump lm 2025-08-23 18:14:10 -04:00
.mailmap Add mailmap 2019-06-11 09:30:14 +02:00
.sbtopts Restore .sbtopts file 2020-11-19 12:42:26 -08:00
.scalafmt.conf [2.x] ci: Integrate launcher package (#8485) 2026-01-11 22:30:50 -05:00
CONTRIBUTING.md Minor updates on development guide 2023-10-21 21:00:31 -04:00
DEVELOPING.md [1.x] Building sbtn locally for Aarch64 2025-09-02 01:32:19 -04:00
LICENSE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
NOTICE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
PROFILING.md fix typo 2018-07-08 22:18:57 +09:00
README.md Update badges 2022-07-04 11:11:49 -04:00
SUPPORT.md Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
build.sbt [1.x] Bump sbtn to 2.0.0-RC13 (#9139) 2026-04-27 01:01:00 -04:00
reset.sh 1.0.3-SNAPSHOT 2017-09-16 15:52:58 -04:00
sbt sbt 1.12.11 2026-05-02 16:29:03 -04:00
sbt-allsources.sh Build from fresh modules 2020-11-14 14:23:48 -05:00
sbt.sh Implement sbt-launch.jar download 2021-04-19 23:43:15 -04:00
server.md setting query is "sbt/setting" 2017-10-03 01:45:06 -04:00

README.md

CI Latest version Discord

sbt

sbt is a build tool for Scala, Java, and more.

For general documentation, see https://www.scala-sbt.org/.

sbt 1.x

This is the 1.x series of sbt. The source code of sbt is split across several GitHub repositories, including this one.

  • sbt/io hosts sbt.io module.
  • sbt/librarymanagement hosts sbt.librarymanagement module that wraps Ivy.
  • sbt/zinc hosts Zinc, an incremental compiler for Scala.
  • sbt/sbt, this repository hosts modules that implements the build tool.
  • Setup: Describes getting started with the latest binary release.
  • FAQ: Explains how to get help and more.
  • sbt/sbt-zero-seven: hosts sbt 0.7.7 and earlier versions

Issues and Pull Requests

Please read CONTRIBUTING carefully before opening a GitHub Issue.

The short version: try searching or asking on StackOverflow.

license

See LICENSE.