You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=== What steps will reproduce the problem (please be specific and use wikiformatting)? ===
There are three ways I am aware of for exiting the scala REPL:
Typing "exit"[RETURN] - this appeared to be the standard approach under 2.8
Typing [CTRL]-[D] - under 2.8 this displayed "exit" and executed it as if you had entered the above.
Typing ":quit"[RETURN]
=== What is the expected behavior? ===
All the above options worked fine under 2.8. They displayed what you would expect and exited cleanly.
=== What do you see instead? ===
Under 2.9.0:
Entering "exit"[RETURN] returns the message warning: there were 1 deprecation warnings; re-run with -deprecation for details. This is, as I understand it, because of the change in the definition of exit which I believe now should be replaced with System.exit(0) in code. However, in this context the error message is totally unintuitive and gives the impression that the REPL is faulty.
Entering [CTRL]-[D] exits cleanly but does not display anything and does not issue a newline so the user's terminal prompt is displayed after the scala> prompt. It should either issue a newline or behave in a similar fashion to 2.8 by displaying either System.exit(0) or more neatly :quit.
Entering :quit works fine.
The first case above is the main problem here as it has been the common way of exiting the REPL in the past. Ideally this specific case of the use of "exit" should be handled differently in the REPL and allowed to exit cleanly. If there is a reason why users should be discouraged from using this from now on then it would help a lot if the default deprecation message was replaced with a more transparent message like:
Use of "exit" has been deprecated, please exit the REPL using the command ":quit" or CTRL-D
=== What versions of the following are you using? ===
Scala: 2.9.0.RC4 (and latest nightly)
Java: 1.6.0_24
Operating system: Mac OS 10.6 / 7
The text was updated successfully, but these errors were encountered:
@som-snytt said (edited on Jul 23, 2014 3:29:21 PM UTC):
Also, the command syntax for sbt and repl is not uniform, so that I'm in the habit of using ctl-D always.
Unfortunately, that's one or two ctl-D's depending on if you ran sbt console or just console at the sbt prompt. Sometimes I lose a terminal window.
The other workaround is to start your repl with an exit function predefined. In fact, I just added it to my init.script.
Oops, actually I already had import sys.exit. It really is nicer to {code}def exit = { Console println "Bye." ; sys.exit } {code}. What a friendly repl.
Now if only repl wouldn't balk when I accidentally :wq instead. Maybe it can do command aliases.
=== What steps will reproduce the problem (please be specific and use wikiformatting)? ===
There are three ways I am aware of for exiting the scala REPL:
=== What is the expected behavior? ===
All the above options worked fine under 2.8. They displayed what you would expect and exited cleanly.
=== What do you see instead? ===
Under 2.9.0:
warning: there were 1 deprecation warnings; re-run with -deprecation for details
. This is, as I understand it, because of the change in the definition of exit which I believe now should be replaced withSystem.exit(0)
in code. However, in this context the error message is totally unintuitive and gives the impression that the REPL is faulty.scala>
prompt. It should either issue a newline or behave in a similar fashion to 2.8 by displaying eitherSystem.exit(0)
or more neatly:quit
.:quit
works fine.The first case above is the main problem here as it has been the common way of exiting the REPL in the past. Ideally this specific case of the use of "exit" should be handled differently in the REPL and allowed to exit cleanly. If there is a reason why users should be discouraged from using this from now on then it would help a lot if the default deprecation message was replaced with a more transparent message like:
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: