-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Print a hint if the user types exit
in the REPL (implemented by customizing Base.show
for typeof(exit)
)
#44164
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
Conversation
…tomizing `Base.show` for `typeof(exit)`)
cc: @mkitti |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems okay, but feels a little odd that display
will have this text in all cases, not just the REPL. I think this might be better:
diff --git a/stdlib/REPL/src/REPL.jl b/stdlib/REPL/src/REPL.jl
index 3308760046..cb7163aeab 100644
--- a/stdlib/REPL/src/REPL.jl
+++ b/stdlib/REPL/src/REPL.jl
@@ -301,6 +301,9 @@ function print_response(errio::IO, response, show_value::Bool, have_color::Bool,
println(errio, "Error showing value of type ", typeof(val), ":")
rethrow()
end
+ if response === exit
+ println("Hint: To exit Julia, use Ctrl-D or type exit() and press enter.")
+ end
end
end
break
To review, we've explored a few ways of doing this, and come full circle:
|
Would making it conditional on |
Thinking of the bigger picture here, why doesn't the REPL have it's own MIME type? |
Was I on that triage call? This is absolutely not the right way to implement this. You don't want to change what the |
Same thing I posted in 2017 btw. |
So #42011? |
That's not ideal either; a string operation like how we handle |
|
While we're at it, we can fix
|
@DilumAluthge , Jeff, leading triage, says to go back to #38522 , with the binding resolved enhancement he suggested. |
Same thing for |
This implements the suggestion from triage in #42011 (comment) and #42011 (comment).