-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Execution of ! less /etc/passwd
hangs in jupyter notebooks
#304
Comments
Yes, this is a known limitation. There's a mismatch between our protocol - which uses an explicit request for input - and terminal interaction, where input can be written at any point. The environment for running shell commands 'looks like' a terminal because many commands (like ls) use this to decide to produce human-friendly output (e.g. using colours, laying things out in columns). Our output handling has some of the capabilities of a terminal emulator, but not all of them. So whether we decide to 'look like' a terminal or not, there's always something that's not quite right. |
Is there a way to identify my program is run by ipython kernel? Some environment variable maybe? |
A lot of tools which page their output will respect a |
Yes, using PAGER is a good idea, thanks. And I would be very happy if IPython would set that variable automatically |
I went to work on that, but discovered that we've been setting PAGER all along - it was added in 2010. b3d10b8 |
By now I implemented honouring the pager variable from our side for our tools and I can confirm that this works as expected. Seems the problem was mostly on our side, sorry for the noise |
It seems that trying to execute any command which will wait for input will hang in jupyter notebooks.
When using
!
to execute a shell command the terminal is set to be an interactive tty. This is a problem for programs like "less" which check if the terminal is a tty and behave accordingly:will show the first less screen and keep the kernel in busy state waiting for input while
or
work as expected.
The text was updated successfully, but these errors were encountered: