vscode: CTRL+A randomly breaks in Jupyter notebooks

Sometimes, while using a Python jupyter notebook, my CTRL+A will randomly stop working. I won’t be able to select all text in a code block. I will be able to CTRL+A in the output and actually, sometimes, doing that AND pasting it a code block with then ‘free’ CTRL+A, but sometimes it won’t and the only way out is to close my notebook and open it again which is really quite disruptive and annoying since I have to run everything again.

This bug started maybe 1-2 months ago now.

My build is:

Version: 1.90.0 (user setup)
Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573
Date: 2024-06-04T19:33:54.889Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22621

My Jupyter version is v2024.5.0.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 61
  • Comments: 26 (1 by maintainers)

Most upvoted comments

I reproduced the bug and found a workaround:

  • To reproduce the bug, right click on an output cell.
  • To apply the workaround, click on “More Actions…”.

https://github.com/user-attachments/assets/6e50e205-cb24-4524-bcc3-affc1f1dae6e

Hope this helps!

Thought it was just me! I have the same problem. The only thing I could imagine is that another extension is taking over the Ctrl-A shortcut but that doesn’t explain why is intermittent

I also have this issue. In my case, I’ve also noticed that when this starts (i.e., when the notebook starts ignoring my ctrl+A commands), it also seems to break the escape button’s behavior. Specifically:

  • When I have a code suggestion and try to ignore the suggestion using the escape key, the notebook instead interprets this as me trying to stop editing the active cell, and it completely removes the cursor from the current cell (I think it may be executing notebook.cell.quitEdit or something).
  • Same thing above happens if I have multiple cursors and try to escape to get rid of the multiple cursors. Instead of doing the intended behavior (which is to give me back a single cursor), it stops editing the current cell.

As mentioned above, this happens only when the ctrl+A issue starts.

Suffering from the same problem.

Jupyter extentsion version: v2024.5.0 vscode version: 1.90.1

Hi there, suffering from the same issue.

I reproduced the bug and found a workaround:

  • To reproduce the bug, right click on an output cell.
  • To apply the workaround, click on “More Actions…”.

ctrl_a_bug.mp4 Hope this helps!

This one works!!! Thanks.!!!

Hey there, suffering same issue myself. Randomly selecting all text with Ctrl + A inside cells breaks. Reloading window or closing and reopening app usually fixes problem.

Extensions installed are these: bierner.markdown-mermaid@1.23.1 github.copilot@1.208.0 github.copilot-chat@0.16.1 mechatroner.rainbow-csv@3.12.0 ms-python.black-formatter@2024.2.0 ms-python.debugpy@2024.6.0 ms-python.python@2024.8.1 ms-python.vscode-pylance@2024.6.1 ms-toolsai.jupyter@2024.5.0 ms-toolsai.jupyter-keymap@1.1.2 ms-toolsai.jupyter-renderers@1.0.18 ms-toolsai.vscode-jupyter-cell-tags@0.1.9 ms-toolsai.vscode-jupyter-slideshow@0.1.6

VSCODE version : 1.90.2 **OS: ** Windows 22621.3737

@umarbutler @kheuton Is CTRL+A not working in the text editor (cells) or in the outputs?

For me, it doesn’t work in the cells but it does work in the outputs.

As I mentioned earlier, sometimes, if I try doing CTRL+A in an output and copy the result into a cell, I will then be able to use CTRL+A again. Most of the time, however, that isn’t the case.

Please can you share a screen recording as well.

I’m not able to share a screen recording as the bug seems to happen randomly and I would prefer not to share private code.

Image

It helped me when I removed the trigger condition

I reproduced the bug and found a workaround:

  • To reproduce the bug, right click on an output cell.
  • To apply the workaround, click on “More Actions…”.

Awesome, this fixes it for me. I can also restore functionality by right-clicking an output cell again. Right-clicking an output cell seems to toggle the ability to use Ctrl+A