-
Notifications
You must be signed in to change notification settings - Fork 92
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
Console: Shell commands cannot accept user input in Python consoles #696
Comments
Can recreate with the |
The thing that makes this hard is that the "awaiting user input" state is difficult to detect in child processes. From the perspective of the Python kernel, the This only works in IPython by accident; IPython doesn't do anything special other than (correctly) forward stuff you type while a child process is active to the child process's stdin. There's no mechanism for doing that in Positron. One way to fix this would be to make the IPython kernel try to detect that there's a prompt active and ask Positron to supply input for the prompt (using the normal prompt input flow over the Another approach, which would be more expensive but probably more correct, would be to alert Positron to the fact that a subprocess is active; in this mode, the Console would just toss all user input over to the kernel to be fed as stdin to the child process. Then we wouldn't have to detect a prompt. |
This is also present in Jupyter Lab and VSCode notebooks. Adding some more context to Jonathan's diagnosis: Here's the issue currently tracking this for Jupyter Lab: jupyterlab/jupyterlab#14041. Here's a really old issue that tracked this in IPython but was accidentally closed in a repo reorg: ipython/ipython#514. Here's an issue in the third party bash_kernel project that has a useful discussion: takluyver/bash_kernel#113. |
If this is something that Jupyter Lab and VS Code also have not fixed as of today, I would like to vote for moving this to the Future milestone and we wait to see the best way to address it further down the line. |
I encountered this when trying to do
pip uninstall ipdb
which requires me to enterY
, but I'm unable to:A simpler example is:
>>> !read
which has the same issue.
Both of these work in IPython.
Might be related to #284?
The text was updated successfully, but these errors were encountered: