sbt, the interactive build tool
Go to file
Ethan Atkins 9218d3c087 Redraw command prompt after network command
Presently if a server command comes in while in the shell, the client
output can appear on the same line as the command prompt and the command
prompt will not appear again until the user hits enter. This is a
confusing ux. For example, if I start an sbt server and type
the partial command "comp" and then start up a client and run the clean
command followed by a compile, the output looks like:

[info] sbt server started at local:///Users/ethanatkins/.sbt/1.0/server/51cfad3281b3a8a1820a/sock
sbt:scala-compile> comp[info] new client connected: network-1
[success] Total time: 0 s, completed Dec 12, 2019, 7:23:24 PM
[success] Total time: 0 s, completed Dec 12, 2019, 7:23:27 PM
[success] Total time: 2 s, completed Dec 12, 2019, 7:23:31 PM

Now, if I type "ile\n", I get:
[info] sbt server started at local:///Users/ethanatkins/.sbt/1.0/server/51cfad3281b3a8a1820a/sock
ile
[success] Total time: 0 s, completed Dec 12, 2019, 7:23:34 PM
sbt:scala-compile>

Following the same set of inputs after this change, I get:
[info] sbt server started at local:///Users/ethanatkins/.sbt/1.0/server/51cfad3281b3a8a1820a/sock
sbt:scala-compile> comp
[info] new client connected: network-1
[success] Total time: 0 s, completed Dec 12, 2019, 7:25:58 PM
sbt:scala-compile> comp
[success] Total time: 0 s, completed Dec 12, 2019, 7:26:14 PM
sbt:scala-compile> comp
[success] Total time: 1 s, completed Dec 12, 2019, 7:26:17 PM
sbt:scala-compile> compile
[success] Total time: 0 s, completed Dec 12, 2019, 7:26:19 PM
sbt:scala-compile>

To implement this change, I added the redraw() method to LineReader
which is a wrapper around ConsoleReader.drawLine; ConsoleReader.flush().
We invoke LineReader.redraw whenever the ConsoleChannel receives a
ConsolePromptEvent and there is a running thread.

To prevent log lines from being appended to the prompt line, in the
CommandExchange we print a newline character whenever a new command is
received from the network or a network client connects and we believe
that there is an active prompt.
2020-05-01 12:35:43 -07:00
.github/ISSUE_TEMPLATE Update issue template 2020-02-03 14:28:20 -05:00
core-macros/src/main/scala/sbt/internal/util/appmacro Document parts of AList & components of TupleSyntax 2020-02-17 07:15:37 +00:00
internal Redraw command prompt after network command 2020-05-01 12:35:43 -07:00
launch Adds sbt.boot.lock sysprop to opt-out 2018-02-08 13:02:39 +00:00
licenses move remaining pieces of sbt subproject to sbt_pending and fix notices 2010-09-21 21:55:50 -04:00
main Redraw command prompt after network command 2020-05-01 12:35:43 -07:00
main-actions/src Add Terminal abstraction 2020-05-01 12:35:43 -07:00
main-command/src Redraw command prompt after network command 2020-05-01 12:35:43 -07:00
main-settings/src Merge pull request #5439 from dwijnand/introduce-Taskable 2020-02-28 10:43:16 -05:00
notes Set swoval.tmpdir with absolute path via globalBasePath (#5048) 2019-09-09 14:13:34 -04:00
project Zinc 1.4.0-M3 2020-04-24 17:44:15 -04:00
protocol/src/main Contraband 0.4.6 2020-04-24 17:44:15 -04:00
run Improve run command warning 2020-05-01 12:35:43 -07:00
sbt/src Mark nio/external-hooks as pending 2020-04-24 18:26:21 -04:00
scripted-plugin/src/main/scala/sbt -Xfatal-warnings in most subprojects 2018-09-18 11:47:55 -04:00
scripted-sbt-old/src/main/scala/sbt/test Update header 2018-09-14 04:53:36 -04:00
scripted-sbt-redux Use Array to talk to proper build 2020-03-18 16:28:51 -04:00
server-test/src Update scala to 2.12.11 2020-03-18 00:49:14 -07:00
src/main/conscript sbt 1.3.0 2019-09-04 01:24:08 -04:00
tasks Merge branch 'develop' into handle-interrupted-exception-in-completion-service-task 2020-02-25 13:09:52 +01:00
tasks-standard apply -Yno-lub 2019-10-13 23:46:23 -04:00
testing Contraband 0.4.6 2020-04-24 17:44:15 -04:00
util-cache Don't use last modified time of directories in doc 2020-01-13 13:11:09 -08:00
util-tracking update scaladoc to reflect argument type of the overload 2020-04-24 16:54:48 +02:00
vscode-sbt-scala fix typo 2019-06-06 08:05:16 +03:00
zinc-lm-integration/src integrate with VirtualFile changes 2020-04-24 17:44:14 -04:00
.appveyor.yml Drop Visual Studio 2015 testing 2019-09-19 13:37:11 -04:00
.gitattributes Contraband 0.4.6 2020-04-24 17:44:15 -04:00
.gitignore add .idea to .gitignore 2019-08-16 00:57:05 +03:00
.java-version Configure JVM 1.8 in .java-version 2016-10-07 08:48:23 -05:00
.mailmap Add mailmap 2019-06-11 09:30:14 +02:00
.sbtopts Use .sbtopts to increase the RAM 2018-06-25 19:40:15 -04:00
.scalafmt.conf Upgrade scalafmt 2020-01-12 13:52:10 -08:00
.travis.yml Update scala to 2.12.11 2020-03-18 00:49:14 -07:00
CONTRIBUTING.md Split some of the developing related docs to DEVELOPING.md 2019-07-15 12:39:41 -04:00
DEVELOPING.md Update DEVELOPING about nightlies (#5133) 2019-09-25 23:19:58 -04:00
LICENSE Apache License 2.0 2018-09-14 03:38:58 -04:00
NOTICE Apache License 2.0 2018-09-14 03:38:58 -04:00
PROFILING.md fix typo 2018-07-08 22:18:57 +09:00
README.md util has been merged-in the main repo 2020-04-24 12:00:12 +02:00
SUPPORT.md Split support into SUPPORT.md 2018-04-25 14:55:09 +01:00
build.sbt Mima 2020-04-24 17:44:15 -04:00
reset.sh 1.0.3-SNAPSHOT 2017-09-16 15:52:58 -04:00
sbt-allsources.sh Bump underlying modules to latest 2017-03-23 12:41:24 -04:00
server.md setting query is "sbt/setting" 2017-10-03 01:45:06 -04:00

README.md

Build Status Latest version Gitter Chat

sbt

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

For general documentation, see http://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.