sbt/internal
Ethan Atkins 58822cc3f5 Add virtual System.out for supershell
In order to make supershell work with println, this commit introduces a
virtual System.out to sbt. While sbt is running, we override the default
java.lang.System.out, java.lang.System.in, scala.Console.out and
scala.Console.in (unless the property `sbt.io.virtual` is set to
something other than true). When using virtual io, we buffer all of the
bytes that are written to System.out and Console.out until flush is
called. When flushing the output, we check if there are any progress
lines. If so, we interleave them with the new lines to print.

The flushing happens on a background thread so it should hopefully not
impede task progress.

This commit also adds logic for handling progress when the cursor is not
all the way to the left. We now track all of the bytes that have been
written since the last new line. Supershell will then calculate the
cursor position from those bytes* and move the cursor back to the
correct position. The motivation for this was to make the run command
work with supershell even when multiple main classes were specified.

* This might not be completely reliable if the string contains ansi
cursor movement characters.
2020-05-01 12:35:43 -07:00
..
util-collection Fix a message about an undefined setting 2020-03-13 12:53:44 +07:00
util-complete Move JLine apis into LineReader 2020-05-01 12:35:43 -07:00
util-control Add util headers 2019-12-08 10:29:22 -08:00
util-interface/src/main/java/xsbti Apply javafmt in sbt project 2020-01-14 14:38:08 -08:00
util-logging Add virtual System.out for supershell 2020-05-01 12:35:43 -07:00
util-logic/src apply -Yno-lub 2019-10-13 23:46:23 -04:00
util-position/src Add util headers 2019-12-08 10:29:22 -08:00
util-relation/src Add util headers 2019-12-08 10:29:22 -08:00
util-scripted/src/main Apply javafmt in sbt project 2020-01-14 14:38:08 -08:00