-
Notifications
You must be signed in to change notification settings - Fork 5k
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
jupyter console incorrectly interprets arrow keys inside pdb debug sessions #7167
Comments
The "Command Line Output" section above could not be included because it made the post too long, so I have included it here: Command Line Output$ jupyter notebook --debug [D 2023-11-30 12:43:27.410 ServerApp] Searching ['/Users/jason/virtualenvs/jup_bug/etc/jupyter', '/Users/jason/.jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files [D 2023-11-30 12:43:27.410 ServerApp] Looking for jupyter_config in /etc/jupyter [D 2023-11-30 12:43:27.410 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter [D 2023-11-30 12:43:27.410 ServerApp] Looking for jupyter_config in /Users/jason/.jupyter [D 2023-11-30 12:43:27.410 ServerApp] Looking for jupyter_config in /Users/jason/virtualenvs/jup_bug/etc/jupyter [D 2023-11-30 12:43:27.411 ServerApp] Looking for jupyter_server_config in /etc/jupyter [D 2023-11-30 12:43:27.411 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter [D 2023-11-30 12:43:27.411 ServerApp] Looking for jupyter_server_config in /Users/jason/.jupyter [D 2023-11-30 12:43:27.411 ServerApp] Looking for jupyter_server_config in /Users/jason/virtualenvs/jup_bug/etc/jupyter [D 2023-11-30 12:43:27.412 ServerApp] Paths used for configuration of jupyter_server_config: /etc/jupyter/jupyter_server_config.json [D 2023-11-30 12:43:27.412 ServerApp] Paths used for configuration of jupyter_server_config: /usr/local/etc/jupyter/jupyter_server_config.json [D 2023-11-30 12:43:27.412 ServerApp] Paths used for configuration of jupyter_server_config: /Users/jason/.jupyter/jupyter_server_config.json [D 2023-11-30 12:43:27.412 ServerApp] Paths used for configuration of jupyter_server_config: /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_server_config.d/jupyter-lsp-jupyter-server.json /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_server_config.d/jupyter_server_terminals.json /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_server_config.d/jupyterlab.json /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_server_config.d/notebook.json /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_server_config.d/notebook_shim.json /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_server_config.json [I 2023-11-30 12:43:27.414 ServerApp] Package notebook took 0.0000s to import [I 2023-11-30 12:43:27.420 ServerApp] Package jupyter_lsp took 0.0050s to import [W 2023-11-30 12:43:27.420 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_lsp. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server. [I 2023-11-30 12:43:27.422 ServerApp] Package jupyter_server_terminals took 0.0021s to import [I 2023-11-30 12:43:27.422 ServerApp] Package jupyterlab took 0.0000s to import [I 2023-11-30 12:43:27.592 ServerApp] Package notebook_shim took 0.0000s to import [W 2023-11-30 12:43:27.592 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server. [I 2023-11-30 12:43:27.592 ServerApp] jupyter_lsp | extension was successfully linked. [D 2023-11-30 12:43:27.594 TerminalsExtensionApp] Config changed: {'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': }, 'ExtensionApp': {'log_level': 'DEBUG'}} [D 2023-11-30 12:43:27.595 ServerApp] Config changed: {'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': }, 'ExtensionApp': {'log_level': 'DEBUG'}} [I 2023-11-30 12:43:27.595 ServerApp] jupyter_server_terminals | extension was successfully linked. [D 2023-11-30 12:43:27.597 LabApp] Config changed: {'NotebookApp': {}, 'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': }, 'ExtensionApp': {'log_level': 'DEBUG'}} [I 2023-11-30 12:43:27.598 ServerApp] jupyterlab | extension was successfully linked. [D 2023-11-30 12:43:27.600 JupyterNotebookApp] Config changed: {'NotebookApp': {'nbserver_extensions': {'jupyter_nbextensions_configurator': True}}, 'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': }, 'ExtensionApp': {'log_level': 'DEBUG'}} [I 2023-11-30 12:43:27.600 ServerApp] notebook | extension was successfully linked. [D 2023-11-30 12:43:27.702 ServerApp] Paths used for configuration of jupyter_notebook_config: /Users/jason/.jupyter/jupyter_notebook_config.json [D 2023-11-30 12:43:27.702 ServerApp] Paths used for configuration of jupyter_notebook_config: /etc/jupyter/jupyter_notebook_config.json [D 2023-11-30 12:43:27.702 ServerApp] Paths used for configuration of jupyter_notebook_config: /usr/local/etc/jupyter/jupyter_notebook_config.json [D 2023-11-30 12:43:27.703 ServerApp] Paths used for configuration of jupyter_notebook_config: /Users/jason/.jupyter/jupyter_notebook_config.json [D 2023-11-30 12:43:27.703 ServerApp] Paths used for configuration of jupyter_notebook_config: /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_notebook_config.d/jupyter-lsp-notebook.json /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_notebook_config.d/jupyterlab.json /Users/jason/virtualenvs/jup_bug/etc/jupyter/jupyter_notebook_config.json [W 2023-11-30 12:43:27.703 ServerApp] jupyter_nbextensions_configurator | error adding extension (enabled: True): The module 'jupyter_nbextensions_configurator' could not be found (No module named 'jupyter_nbextensions_configurator'). Are you sure the extension is installed? Traceback (most recent call last): File "/Users/jason/virtualenvs/jup_bug/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 322, in add_extension extpkg = ExtensionPackage(name=extension_name, enabled=enabled) File "/Users/jason/virtualenvs/jup_bug/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 186, in __init__ self._load_metadata() File "/Users/jason/virtualenvs/jup_bug/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 201, in _load_metadata raise ExtensionModuleNotFound(msg) from None jupyter_server.extension.utils.ExtensionModuleNotFound: The module 'jupyter_nbextensions_configurator' could not be found (No module named 'jupyter_nbextensions_configurator'). Are you sure the extension is installed? [I 2023-11-30 12:43:27.703 ServerApp] notebook_shim | extension was successfully linked. [D 2023-11-30 12:43:27.704 ServerApp] Config changed: {'ExtensionApp': {'log_level': 'DEBUG'}, 'NotebookApp': {'nbserver_extensions': {'jupyter_nbextensions_configurator': True}}, 'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': }} [D 2023-11-30 12:43:27.704 ServerApp] Raising open file limit: soft 256->4096; hard 9223372036854775807->9223372036854775807 [I 2023-11-30 12:43:27.718 ServerApp] notebook_shim | extension was successfully loaded. [D 2023-11-30 12:43:27.719 ServerApp] [lsp] rootUri will be file:///Users/jason/temp/empty [D 2023-11-30 12:43:27.719 ServerApp] [lsp] virtualDocumentsUri will be file:///Users/jason/temp/empty/.virtual_documents [I 2023-11-30 12:43:27.719 ServerApp] jupyter_lsp | extension was successfully loaded. [I 2023-11-30 12:43:27.719 ServerApp] jupyter_server_terminals | extension was successfully loaded. [I 2023-11-30 12:43:27.720 LabApp] JupyterLab extension loaded from /Users/jason/virtualenvs/jup_bug/lib/python3.9/site-packages/jupyterlab [I 2023-11-30 12:43:27.720 LabApp] JupyterLab application directory is /Users/jason/virtualenvs/jup_bug/share/jupyter/lab [I 2023-11-30 12:43:27.720 LabApp] Extension Manager is 'pypi'. [D 2023-11-30 12:43:27.721 LabApp] Extensions list will be fetched from https://pypi.org/pypi. [I 2023-11-30 12:43:27.722 ServerApp] jupyterlab | extension was successfully loaded. [I 2023-11-30 12:43:27.723 ServerApp] notebook | extension was successfully loaded. [I 2023-11-30 12:43:27.724 ServerApp] Serving notebooks from local directory: /Users/jason/temp/empty [I 2023-11-30 12:43:27.724 ServerApp] Jupyter Server 2.11.1 is running at: [I 2023-11-30 12:43:27.724 ServerApp] http://localhost:8888/tree?token=ea2434cc2e1fca0bf6e948aeed26ca572ac617c7924492c4 [I 2023-11-30 12:43:27.724 ServerApp] http://127.0.0.1:8888/tree?token=ea2434cc2e1fca0bf6e948aeed26ca572ac617c7924492c4 [I 2023-11-30 12:43:27.724 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2023-11-30 12:43:27.730 ServerApp] |
Thinking that interpretation of special keys may be affected by environment settings, I also compared the environment as instantiated within both
Here are the differences:
I'm not sure if any are important, though I'll note that for whatever reason,
|
Thank you for opening this issue @yosinski, as this is an where the fix would be provided to |
Description
When running
jupyter console
from the terminal and entering the pdb (ipdb) debugger, arrow keys and and other keys are not interpreted correctly. I've tried to find a fix for this and have not found anything.Reproduce
To reproduce, I'll show a difference between the correct behavior when running using
ipython
and incorrect behavior withinjupyter console
.pip install jupyter
ipython works as expected
%debug
magic line:asdf<left arrow><left arrow>
. The cursor moves back as expected:jupyter console does not work as expected
%debug
magic line:asdf<left arrow><left arrow>
. The arrow keys are misinterpretted as^[[D
:readline
style keys that usually work also fail here, e.g.C-a
to go to the beginning of the line works inipython
but does not injupyter console
.Expected behavior
Expected: arrow keys that work correctly within
ipython
would also work withinjupyter console
.Actual:
jupyter console
misinterprets arrow keys.Context
Troubleshoot Output
Command Line Output
Browser Output
The text was updated successfully, but these errors were encountered: