Unexpected Cell Type Changes with Digits Entry in Jupyter Notebook

Recently, I’ve noticed a perplexing problem: whenever I attempt to input digits as part of user input, the cell type automatically changes, as if the numbers are being interpreted as shortcuts to modify cell types.

In an effort to troubleshoot, I have reinstalled both Jupyter Notebook, restarted my Windows system, and even opened my code in a new file. Unfortunately, none of these steps have resolved the issue. Despite extensive research online, I have been unable to find any information suggesting that this behavior is normal or expected.

At this point, I am beginning to suspect that this might be a bug within Jupyter Notebook itself. However, I am unsure of how to proceed in troubleshooting or resolving it.

If any members of the community have experienced a similar problem or have any insights or suggestions on how to address it, I would be immensely grateful for your assistance.

1 Like

I know what problem you are facing. There were patches for that I authored that were released a few weeks back.

  1. Which version of JupyterLab/Jupyter Notebook do you have installed?
  2. If the answer for the above is 4.1.5 / 7.1.2, can you share a full reproducer (what kind of an input do you work with, code to create the input).
  3. If the answer is older version, can you upgade, test, and if it still provide a reproducer?

Also, Preventing changing cell type when input is pending to avoid kernel deadlock by krassowski · Pull Request #16032 · jupyterlab/jupyterlab · GitHub that you can test in JupyterLab 4.2.0a2 will prevent changing cell type(including by digit shortcuts) when input is pending - but this only pertains to input requested using native kernel mechanisms, such as using Python’s input() or getpass() methods (if you use a third-party widgets library it may not be relevant).