Problems with shell commands (magic) expecting output
See original GitHub issueThis is related (if not identical) to #514 which I don’t understand why was closed (it was not closed with “impossible to fix” or “we don’t have time to fix” which I would understand).
PR #3089 sounds like it has (at least partially) fixed it, but I am not sure it did. I am running ipython v5.3.0 (with jupyter-client v5.0.0 and jupyter-core v4.3.0). This version of ipython has been released after said PR has been merged, so it should be included, however I have not explicitly looked if that code made into into it.
Usual example: the following hangs forever
!(echo "type something"; read foo; echo $foo)
and whatever one types is interpreted as browser shortcut (if applicable) instead of stdin.
Similarly, and perhaps more difficult to fix because of the way ssh handles input for security reasons, this hangs forever too:
!ssh -o StrictHostKeyChecking=no -T username@someserver.com
As far as I’m concerned, it’d be fine if the magic needs to become aware of the need for input, so I’d be ok with having to replace the above commands with something like
%needs_input !(echo "type something"; read foo; echo $foo)
and
%needs_input !ssh -o StrictHostKeyChecking=no -T username@someserver.com
if that simplify the implementation
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
This seems related to another common problem: debugging a cell with
%pdb on
, then forgetting to quit before changing the cell and re-running it. The output the disappears, so you can’t hit “q” any more to quit, and interrupting the kernel doesn’t help. You have to restart the kernel. See e.g. https://github.com/ipython/ipython/issues/3400 which remains open, but which seems different, since it isn’t clear to me that pdb runs a separate sub-process. If there was a way to runpdb
on the notebook in a terminal emulator, that would be handy.This issue is relatively old but still stands. Seems like there’s not much interest around it though. Have there been any architecture changes to IPython that would make this easier to fix?