vscode-jupyter icon indicating copy to clipboard operation
vscode-jupyter copied to clipboard

No way to escape from VisualMode to NormalMode on Jupyter Focused Cell

Open changhoon-sung opened this issue 11 months ago • 0 comments

Applies To

  • [x] Notebooks (.ipynb files)
  • [ ] Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Describe the bug This bug occurs when using the Vim extension together with the Jupyter Notebook extension in VSCode. In a Jupyter Notebook focused cell, pressing the Esc key alone does not transition from Visual Mode back to Normal Mode.

To Reproduce Steps to reproduce the behavior:

  1. Install the Vim extension and Jupyter Notebook extension and open a .ipynb file.
  2. Select any cell and enter Visual Mode by pressing the v key.
  3. Attempt to return to Normal Mode by pressing the Esc key.
  4. Check the visual mode remaining on the bottom status bar.

Expected behavior Pressing the Esc key should transition from Visual Mode to Normal Mode while maintaining focus on the Jupyter Notebook cell.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.29.0
  • Extension (ms-toolsai.jupyter) version: 2025.1.0
  • VSCode version: 1.97.2
  • OS: macOS Sequoia 15.3.1 (24D70)

Additional context Pressing Esc first causes the Jupyter Notebook to lose focus (notebookCellEditorFocused changes from true to false).

However, Visual Mode remains active.

Since editorFocus is also lost when the cell loosing the focus, there's no way to escape from Visual Mode to Normal Mode.

Workaround

{
  "key": "escape",
  "command": "extension.vim_escape",
  "when": "notebookEditorFocused && vim.active && vim.mode == 'Visual'"
}

VS Code Version

1.29.0

Jupyter Extension Version

2025.1.0

Jupyter logs


Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

changhoon-sung avatar Feb 16 '25 04:02 changhoon-sung