Skip to content
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

Ctrl-O prefixed commands not working in jupyterlab>=4.1.0 #138

Open
rpatel opened this issue Feb 28, 2024 · 4 comments
Open

Ctrl-O prefixed commands not working in jupyterlab>=4.1.0 #138

rpatel opened this issue Feb 28, 2024 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed upstream Upstream issue

Comments

@rpatel
Copy link

rpatel commented Feb 28, 2024

Description

Vim command shortcuts that start with Ctrl-O (i.e., Cut Cell, Copy Cell, Paste Cell, Insert Cell Below, Insert Cell Above, Select First Cell, Select Last Cell, Center Cell) are not working since jupyterlab 4.1.0.

At the moment, I am requiring versions jupyterlab==4.0.9 and jupyterlab-vim==4.1.0 to keep these bindings working.

Reproduce

  1. Fresh install:
    pip install 'jupyterlab>=4.1.0,<5.0.0a0' jupyterlab-vim

  2. In new notebook, any selected cell, edit mode, press Ctrl-O, O or Ctrl-O, Ctrl-O, or Ctrl-O, G, etc… the expected jupyter shortcut doesn't happen (i.e., insert cell below/above, select first cell).
    However, the editor does respond with the vim command mapped to the keys after the Ctrl-Os. For example, Ctrl-O, O inserts a new line and switches to insert mode, as if the ^O prefix was never pressed.

Context

  • Python version 3.12.2
    • jupyterlab==4.1.2
    • jupyter_server==2.12.5
    • jupyterlab-vim==4.1.3
  • Operating System and its version: CentOS 7
  • Browser and its version: Chrome 121.0.6167.139

Let me know if can provide any additional information.

@rpatel rpatel added the bug Something isn't working label Feb 28, 2024
@ianhi
Copy link
Collaborator

ianhi commented Feb 29, 2024

I can confirm this bug. @krassowski is there any chance this is related to the shortcut changes again? from https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html#change-of-notebook-focus-handling-impacting-command-mode-shortcut-selectors

Please note that :not(:read-write) fragment disables shortcuts when text fields (such as cell editor) are focused to avoid intercepting characters typed by the user into the text fields, however if your shortcut does not correspond to any key/typographic character (e.g. most shortcuts with Ctrl modifier) you may prefer to drop this fragment if you want the shortcut to be active in text fields.

we aren't using that tag, but maybe the auto conversion of things somehow got us?

here's the definition of an example broken shortcut:

{
"selector": ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-editMode",
"keys": ["Ctrl O", "Shift O"],
"command": "notebook:insert-cell-above"
},

@krassowski
Copy link
Collaborator

we aren't using that tag, but maybe the auto conversion of things somehow got us?

I do not think so. It seems like the events are not properly intercepted so it might be the fallout from the change of the keydown capture mode in jupyterlab 4.1.

@rchavp
Copy link

rchavp commented Apr 26, 2024

Any update on this?

@firai
Copy link
Collaborator

firai commented Jul 5, 2024

@krassowski Is there anything we can do at the extension level? Or do we need to wait until jupyterlab/jupyterlab#15897 is resolved?

@firai firai pinned this issue Jul 10, 2024
@firai firai added the help wanted Extra attention is needed label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed upstream Upstream issue
Projects
None yet
Development

No branches or pull requests

5 participants