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

ipython stops responding after suspending with ctrl-z #191

Closed
jesaerys opened this issue Oct 12, 2014 · 8 comments
Closed

ipython stops responding after suspending with ctrl-z #191

jesaerys opened this issue Oct 12, 2014 · 8 comments

Comments

@jesaerys
Copy link

With other python+ipython installations (e.g., using homebrew), I can suspend a terminal ipython session with ctrl-z, work in the shell for a bit, and then come back to ipython with fg. This does not work with ipython in anaconda. I never get my prompt back after typing fg (even after pressing enter and ctrl-c a few times), so I have to ctrl-z back to the shell and then kill the ipython process.

Is this a bug?

ctrl-z and fg work just fine for the regular python interpreter in anaconda.

I'm on Mac OS 10.9.

@asmeurer
Copy link
Contributor

This likely has to do with the fact it uses python.app.

@asmeurer
Copy link
Contributor

I think it's because ipython runs python.app and python.app starts python in bash. So when you run ipython there are two processes, like

58535 ttys011    0:00.04 /bin/bash /Users/aaronmeurer/anaconda/bin/python.app /Users/aaronmeurer/anaconda/bin/ipython
58536 ttys011    0:00.59 /Users/aaronmeurer/anaconda/python.app/Contents/MacOS/python /Users/aaronmeurer/anaconda/bin/ipython

If I manually kill -SIGCONT 58536 in addition to running fg, it restarts.

@asmeurer
Copy link
Contributor

It also works if I run fg %1, which should be a usable workaround for you.

@asmeurer
Copy link
Contributor

I wonder if it's possible to add a trap to the python.app script that makes this work as expected.

@jesaerys
Copy link
Author

Thanks, these suggestions seem to work. I'll close this issue.

Are you referring to anaconda/bin/python.app? It looks like that file is just a two line bash script. Otherwise there's anaconda/python.app/Contents/MacOS/python, but that's binary so I can't edit it.

@asmeurer
Copy link
Contributor

Yes, I mean the bin/python.app. It is a two-line bash script, but the issue is that ipython uses it as its shebang line, resulting in two processes when ipython starts.

@keflavich
Copy link

I had asked a question about this here (after this issue was raised... so I just missed it when googling or it wasn't indexed yet), and the answer in this thread worked for me.

@ideascidata
Copy link

I realize this is a blast from the past...but I finally was able to figure out a working solution in Anaconda!

CTRL+S worked for me when using jupyter notebook with Anaconda.

You must use this key combo in the terminal for this to work. Also, other key combinations that didn't work for me but were suggested elsewhere include: CTRL+Z and CTRL+I

Hopefully this can at least help out someone down the line...

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

No branches or pull requests

4 participants