Search code examples
scalaapache-sparkread-eval-print-loop

In Scala REPL, how to discard partly written multi-line command?


On Unix Shell terminal, you can discard a typed command just by typing ctrl-c. Is there a way to discard a typed command on Scala REPL?


Solution

  • When you're writing an unfinished block you can enter two blank lines and the REPL will then skip your command and start a new one.

    You may then still use up buttons to retrieve the lines you want to continue with in the new command.