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

fix broken interrupt-kernel on unix #163

Merged
merged 1 commit into from
Feb 24, 2018
Merged

Conversation

jackkamm
Copy link
Contributor

@jackkamm jackkamm commented Feb 23, 2018

This fixes #115 (broken ob-ipython-interrupt-kernel) on linux and (probably) mac.

To interrupt the kernel, SIGINT needs to be sent to the appropriate process. This process is not the "jupyter console" process itself, but rather a child process of it ("python -m ipykernel_launcher ..."). The old code was sending SIGINT to the wrong process.

As the process to signal is not a direct subprocess of emacs, I had to resort to unix tools to interrupt it, so this won't work on windows. An alternative approach might be to start the kernel with ipython kernel instead of jupyter console, then it would be a direct subprocess of emacs and we could interrupt it with (interrupt-process) as before.

Note it currently appears impossible to interrupt remote kernel, as noted in jupyter/jupyter_console#150

@jackkamm jackkamm changed the title fixes ob-ipython-interrupt-kernel on *nix partial fix for #115 (broken interrupt-kernel) Feb 23, 2018
@jackkamm jackkamm changed the title partial fix for #115 (broken interrupt-kernel) fix broken interrupt-kernel on unix Feb 23, 2018
@gregsexton gregsexton merged commit 7147455 into gregsexton:master Feb 24, 2018
@gregsexton
Copy link
Owner

Awesome work, thanks for fixing this.

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.

Cannot interrupt kernel without killing it
2 participants