From ed9dfee181e56bb83afa0598523786bee5572068 Mon Sep 17 00:00:00 2001 From: Antoine Gourlay Date: Tue, 29 Jul 2014 18:12:42 +0200 Subject: SI-4563 friendlier behavior for Ctrl+D in the REPL Closing the REPL with Ctrl+D does not issue a newline, so the user's prompt displays on the same line as the `scala>` prompt. This is bad. We now force a newline before closing the interpreter, and display `:quit` while we're at it so that people know how to exit the REPL (since `exit` doesn't exist anymore). The tricky part was to only add a newline when the console is interrupted, and *not* when it is closed by a command (like `:quit`), since commands are processed after their text (including newline) has been sent to the console. --- test/files/jvm/interpreter.check | 2 +- test/files/jvm/throws-annot-from-java.check | 2 +- test/files/jvm/xml05.check | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test/files/jvm') diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check index d124794e72..d03edb638c 100644 --- a/test/files/jvm/interpreter.check +++ b/test/files/jvm/interpreter.check @@ -361,7 +361,7 @@ It would fail on the following inputs: Exp(), Term() ^ f: (e: Exp)Int -scala> +scala> :quit plusOne: (x: Int)Int res0: Int = 6 res0: String = after reset diff --git a/test/files/jvm/throws-annot-from-java.check b/test/files/jvm/throws-annot-from-java.check index be3ba412f8..c541b26fcc 100644 --- a/test/files/jvm/throws-annot-from-java.check +++ b/test/files/jvm/throws-annot-from-java.check @@ -44,4 +44,4 @@ bar tp.typeParams.isEmpty: true throws[test.PolymorphicException[_]](classOf[test.PolymorphicException]) -scala> +scala> :quit diff --git a/test/files/jvm/xml05.check b/test/files/jvm/xml05.check index 92ea995350..cad907525d 100644 --- a/test/files/jvm/xml05.check +++ b/test/files/jvm/xml05.check @@ -4,4 +4,4 @@ Type :help for more information. scala> res0: scala.xml.Elem = -scala> +scala> :quit -- cgit v1.2.3