mirror of https://github.com/sbt/sbt.git
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. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||