mirror of https://github.com/sbt/sbt.git
When running reboot at the console, the first character that the user enters after the reboot has completed is lost. This is because it isn't possible to interrupt System.in and we have a thread that is blocking on reads to System.in in WriteableInputStream. That thread cannot be shutdown during normal sbt shutdown while it is reading. When sbt next starts up (in the same jvm), the previous thread gets the byte but has nowhere to write it so the byte is lost. This commit fixes that behavior by ensuring that we only poll from System.in when there is actually a downstream consumer. The behavior of reboot is still a little wonky if the user issues a reboot from a network client and then tries to input commands at the console. In that case, sbt will have been polling System.in in the ask user thread prior to the reboot and the ask user thread will be uninterruptible for the reason described above so the first byte will again by swallowed by the previous sbt instance. This use case is sufficiently pathological that it doesn't feel worth the effort to fix. As annoying as it is, it doesn't break the sbt session. The user will either submit an invalid command with the missing leading character or notice the character is missing, possibly think they missed the key, type backspace a few times and re-type the command. |
||
|---|---|---|
| .. | ||
| util-collection | ||
| util-complete | ||
| util-control | ||
| util-interface/src/main/java/xsbti | ||
| util-logging | ||
| util-logic/src | ||
| util-position/src | ||
| util-relation/src | ||
| util-scripted/src/main | ||