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

Have ^C throw InterruptException #10

Merged
merged 1 commit into from Nov 4, 2017
Merged

Conversation

Keno
Copy link
Contributor

@Keno Keno commented Nov 4, 2017

In general ^C throws InterruptException. The only reason this doesn't
happen in TerminalMenus is because we enable raw mode which makes ^C
just another key sequence. I think it is more coherent to make this
throw an InterruptException as it would in non-raw parts of code.
If the calling code wants to handle this, it can catch the exception.

Fixes JuliaPackaging/BinaryBuilder.jl#35

In general ^C throws InterruptException. The only reason this doesn't
happen in TerminalMenus is because we enable raw mode which makes ^C
just another key sequence. I think it is more coherent to make this
throw an InterruptException as it would in non-raw parts of code.
If the calling code wants to handle this, it can catch the exception.
@codecov-io
Copy link

codecov-io commented Nov 4, 2017

Codecov Report

Merging #10 into master will decrease coverage by 0.03%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #10      +/-   ##
=========================================
- Coverage   53.63%   53.6%   -0.04%     
=========================================
  Files           6       6              
  Lines         220     222       +2     
=========================================
+ Hits          118     119       +1     
- Misses        102     103       +1
Impacted Files Coverage Δ
src/AbstractMenu.jl 39.02% <66.66%> (+0.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b773c55...2ed494d. Read the comment docs.

@nick-paul nick-paul merged commit 2e225f2 into nick-paul:master Nov 4, 2017
@nick-paul
Copy link
Owner

I will merge this and then tag a release for v0.0.4

@nick-paul
Copy link
Owner

@Keno Note: I just added (6254c9d) a configuration option to change the behavior of ^C back to the way is was before (returning -1 or an empty set) if needed. I think you are right in saying that throwing the InterruptException() is generally more coherent behavior so I made it the default option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants