-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support typing "exit" or "quit" means exit from REPL. #19021
Comments
|
that's better, or you could forbid people to define global variable named "quit" or "exit" only in REPL just like what ipython already did and that is considered user friendly. |
I've modified the title to be a little bit more friendly. |
Would you all be opposed to prompting for clarification? The repl makes you type You could do something like: > exit
Did you mean '.exit' [Y/n]? It could default to YES, so, if they simply press return, they’ll exit. If they say NO, it will proceed to run as if exit is a reference. Benefits:
|
Imitate python repl, when the user enters 'exit' or 'quit', no longer prompt 'Reference Error', but prompts 'To exit, press ^D or type .exit'. If the user defines variables named 'exit' or 'quit' , only the value of the variables are output Fixes: nodejs#19021
Imitate python repl, when the user enters 'exit' or 'quit', no longer prompt 'Reference Error', but prompts 'To exit, press ^D or type .exit'. If the user defines variables named 'exit' or 'quit' , only the value of the variables are output PR-URL: #20617 Fixes: #19021 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
And why nodejs doesn't know that?
The text was updated successfully, but these errors were encountered: