Skip to content
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

Improve REPL SIGINT user experience. #17710

Merged
merged 1 commit into from
Jul 31, 2016
Merged

Conversation

yuyichao
Copy link
Contributor

  • Add a SIGINT dead time after a force throw

    Fixes Jeff's issue in Unreliable SIGINT delivery #17706

  • Make the eval and print loop sigatomic to avoid sigint being delivered
    outside try-catch blocks.

@JeffBezanson
Copy link
Sponsor Member

💯 Massive improvement.

@@ -74,6 +76,7 @@ function eval_user_input(ast::ANY, backend::REPLBackend)
iserr, lasterr = true, (err, catch_backtrace())
end
end
ccall(:jl_sigatomic_end, Void, ())
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this is needed --- isn't it dominated by a begin-end sequence?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't really needed in the sense that it should be unreachable. It is needed if we exit normally from the loop though so I included it for completeness (admittedly it won't help if one return from the loop).

It isn't dominated by a begin-end since the leave from the try-catch implicitly reset the defer_signal counter.

@kshyatt kshyatt added the stdlib:REPL Julia's REPL (Read Eval Print Loop) label Jul 30, 2016
* Add a SIGINT dead time after a force throw

    Fixes Jeff's issue in #17706

* Make the eval and print loop sigatomic to avoid sigint being delivered
  outside `try`-`catch` blocks.
@JeffBezanson JeffBezanson merged commit d4a29e5 into master Jul 31, 2016
@yuyichao yuyichao deleted the yyc/signals/dead-time branch July 31, 2016 21:53
@StefanKarpinski
Copy link
Sponsor Member

Can you summarize the behavioral upshot of this change?

@JeffBezanson
Copy link
Sponsor Member

You get a prompt back after ^C instead of julia exiting.

@StefanKarpinski
Copy link
Sponsor Member

Brillant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib:REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants