1. Waiting for source changes in project root... (press enter to interrupt)
In sbt 1.2.x, pressing
<enter> during triggered execution returns the prompt back to where
~compile came from.
~compilewas started from sbt shell, it returns to the sbt shell.
~compilewas started as batch mode, like
sbt "~compile", it returns to zsh (or whatever the system shell).
Making changes to the source code and saving the file triggers the next round with an incremented number:
2. Waiting for source changes in project root... (press enter to interrupt)
[info] 1. Monitoring source files for updates... [info] Project: root [info] Command: compile [info] Options: [info] <enter>: return to the shell [info] 'r': repeat the current command [info] 'x': exit sbt
In sbt 1.3.0-RC2, pressing
<enter> always returns to sbt shell, even if I started
~compile in batch mode.
In addition sbt 1.3.0-RC2 adds two more shortcuts:
'r'reruns the current command.
I also noticed that the instruction text is printed each time triggered execution is triggered by a file save.
[info] 2. Monitoring source files for updates... [info] Project: root [info] Command: compile [info] Options: [info] <enter>: return to the shell [info] 'r': repeat the current command [info] 'x': exit sbt
I’d like to clarify the use cases around
~, and revisit the details.
In my opinion,
<enter> should mean “return one level if you’re waiting, otherwise do so once your current command is done”. I think that’s how sbt 1.2.8 works.
Returning one level here would be sbt shell if you started from sbt shell, and zsh if you started from zsh.
Ctrl-D if we support it, should behave exactly the same as
<enter>: return one level once your current command is done. This is how
Ctrl-D behaves for both Scala REPL and sbt shell.
Ctrl-C should behave similarly to how it behaves for sbt shell.
Global / cancelableis
true, Ctrl-C interrupts the running command and returns one level, back to sbt shell if it was started in sbt shell.
Global / cancelableis
false, Ctrl-C stops sbt, and jumps back to zsh.
Maybe there should be a
? support that prints out all the shortcuts, similar to Gmail etc. Ideally the text blurb should go back to one liner.
For rare situation where someone wants to start from batch mode, but jump to interactive mode, I’d say we can implement something like
's' as the command.
My preference for quitting is using using
'q' as it is available in Scala REPL as
:q. Since Scala’s Predef no longer defines
exit, I think sbt shell should also support