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

PR: Make Ctrl+C to quit Spyder on Posix systems #5159

Merged
merged 2 commits into from
Sep 29, 2017

Conversation

rlaverde
Copy link
Member

@rlaverde rlaverde commented Sep 7, 2017

Fixes #5305

Related to #5114

See: #5129 (comment)

@@ -288,6 +288,7 @@ def signal_handler(signum, frame=None):
pass
else:
signal.signal(signal.SIGTERM, signal_handler)
signal.signal(signal.SIGINT, signal_handler)
Copy link
Member

Choose a reason for hiding this comment

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

Please change this to

if not DEV:
    ...

Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Member

Choose a reason for hiding this comment

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

Because it's useful to have it when working in DEV mode. That way you can get a traceback when Spyder freezes for whatever reason.

Copy link
Member

Choose a reason for hiding this comment

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

Because it's useful to have it when working in DEV mode. That way you can get a traceback when Spyder freezes for whatever reason.

Still this is very unconventional behavior. I am sure there must be a way where we can get a traceback AND quit...

Copy link
Member

Choose a reason for hiding this comment

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

I think very few people uses DEV, so I don't think we should look for more.

Copy link
Member

@goanpeca goanpeca Sep 26, 2017

Choose a reason for hiding this comment

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

could we do that? raise something print the output,, wait a bit and then close spyder?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm yes, raising a exception in the internal console will make spyder quit, although the traceback won't correspond 😕

Copy link
Member

@goanpeca goanpeca Sep 26, 2017

Choose a reason for hiding this comment

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

Hmm yes, raising a exception in the internal console will make spyder quit, although the traceback won't correspond 😕

Then it is not the solution I "requested"!

Copy link
Member Author

Choose a reason for hiding this comment

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

We could also print the other traceback, although I don't like that option.

Maybe skipping the keyboard error where internal console catch errors, although I don't understand the internals of the console and idk if it's possible

Copy link
Member

Choose a reason for hiding this comment

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

@rlaverde, please finish this one with my initial suggestion. I know that's not ideal, but it will affect mainly to us.

signal.signal(signal.SIGINT, signal_handler)
if not DEV:
# Make spyder quit when presing ctrl+C in the console
# In DEV because Ctrl+C doens't quit, because it helps to
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the first because in this line.

Copy link
Member

Choose a reason for hiding this comment

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

This also needs a rebase against 3.x to fix the error in Circle.

Copy link
Member

Choose a reason for hiding this comment

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

doens't -> doesn't

@ccordoba12 ccordoba12 changed the title PR: Handle Ctrl+C to make spyder quit. PR: Make Ctrl+C to quit Spyder Sep 29, 2017
@ccordoba12 ccordoba12 changed the title PR: Make Ctrl+C to quit Spyder PR: Make Ctrl+C to quit Spyder on Posix systems Sep 29, 2017
@ccordoba12 ccordoba12 merged commit 5e13eea into spyder-ide:master Sep 29, 2017
@rlaverde rlaverde deleted the keyboard-interrupt branch September 29, 2017 23:50
@ccordoba12 ccordoba12 modified the milestones: v3.2.4, v4.0beta1 Sep 30, 2017
@ccordoba12 ccordoba12 mentioned this pull request Oct 4, 2017
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.

3 participants