jupyterlab-contrib / jupyterlab-vim

Vim notebook cell bindings for JupyterLab
https://jupyterlab-contrib.github.io/jupyterlab-vim.html
MIT License
660 stars 43 forks source link

Vim editing commands replace cell text with 'NULNUL' in Firefox #139

Open bradrn opened 1 month ago

bradrn commented 1 month ago

Description

When I press a key such as i or a or cc, which moves into insert mode, the cell contents get replaced by ‘NULNUL’ (presumably a visual representation of two NUL bytes):

image

I can get back to the previous state by undoing with u, but I have no way to edit the text without it being replaced by ‘NULNUL’ beforehand.

Notably, this bug is Firefox-specific. Google Chrome shows the expected behaviour.

Reproduce

  1. pip install jupyterlab jupyterlab-vim
  2. Start JupyterLab and open in Firefox
  3. Open a notebook
  4. Select any cell
  5. Press i (or a, etc.)

Expected behavior

JupyterLab-Vim goes into insert mode at the selected place in the cell, without deleting the cell contents or adding any text.

Context

Command Line Output ``` $ jupyter lab [I 2024-05-15 14:22:03.994 ServerApp] jupyter_lsp | extension was successfully linked. [I 2024-05-15 14:22:03.998 ServerApp] jupyter_server_terminals | extension was successfully linked. [I 2024-05-15 14:22:04.002 ServerApp] jupyterlab | extension was successfully linked. [I 2024-05-15 14:22:04.207 ServerApp] notebook_shim | extension was successfully linked. [I 2024-05-15 14:22:04.222 ServerApp] notebook_shim | extension was successfully loaded. [I 2024-05-15 14:22:04.224 ServerApp] jupyter_lsp | extension was successfully loaded. [I 2024-05-15 14:22:04.225 ServerApp] jupyter_server_terminals | extension was successfully loaded. [I 2024-05-15 14:22:04.226 LabApp] JupyterLab extension loaded from /home/bradrn/Documents/University/Saclay/PTCDA/.venv/lib/python3.12/site-packages/jupyterlab [I 2024-05-15 14:22:04.226 LabApp] JupyterLab application directory is /home/bradrn/Documents/University/Saclay/PTCDA/.venv/share/jupyter/lab [I 2024-05-15 14:22:04.227 LabApp] Extension Manager is 'pypi'. [I 2024-05-15 14:22:04.237 ServerApp] jupyterlab | extension was successfully loaded. [I 2024-05-15 14:22:04.238 ServerApp] Serving notebooks from local directory: /home/bradrn/Documents/University/Saclay/PTCDA [I 2024-05-15 14:22:04.238 ServerApp] Jupyter Server 2.14.0 is running at: [I 2024-05-15 14:22:04.238 ServerApp] http://localhost:8888/lab?token=afd89715296ef5b2500b496e894d86c6cb0dc8be2712df00 [I 2024-05-15 14:22:04.238 ServerApp] http://127.0.0.1:8888/lab?token=afd89715296ef5b2500b496e894d86c6cb0dc8be2712df00 [I 2024-05-15 14:22:04.238 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2024-05-15 14:22:06.408 ServerApp] To access the server, open this file in a browser: file:///home/bradrn/.local/share/jupyter/runtime/jpserver-25157-open.html Or copy and paste one of these URLs: http://localhost:8888/lab?token=afd89715296ef5b2500b496e894d86c6cb0dc8be2712df00 http://127.0.0.1:8888/lab?token=afd89715296ef5b2500b496e894d86c6cb0dc8be2712df00 [I 2024-05-15 14:22:06.747 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server [I 2024-05-15 14:22:11.868 LabApp] Build is up to date [I 2024-05-15 14:22:15.812 ServerApp] Kernel started: ce3b0ff7-0532-4062-a01c-5ab0379374bb [I 2024-05-15 14:22:16.363 ServerApp] Connecting to kernel ce3b0ff7-0532-4062-a01c-5ab0379374bb. [I 2024-05-15 14:22:16.375 ServerApp] Connecting to kernel ce3b0ff7-0532-4062-a01c-5ab0379374bb. [I 2024-05-15 14:22:16.388 ServerApp] Connecting to kernel ce3b0ff7-0532-4062-a01c-5ab0379374bb. ``` There was no further output between here and when I shut down the kernel.
Web Browser Output
Language pack 'en_GB' not installed! [jlab_core.b207cc5f30e679038452.js:1:1580033](http://localhost:8888/static/lab/jlab_core.b207cc5f30e679038452.js?v=b207cc5f30e679038452)
Starting application in workspace: "default" [jlab_core.b207cc5f30e679038452.js:1:8982](http://localhost:8888/static/lab/jlab_core.b207cc5f30e679038452.js?v=b207cc5f30e679038452)
Deprecated shortcut selectors: ".jp-Notebook.jp-mod-commandMode :focus:not(:read-write)" was replaced with ".jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus" in JupyterLab 4.1.1 (present in ".jp-NotebookPanel[data-jp-vim-mode='true'] .jp-Notebook.jp-mod-commandMode :focus:not(:read-write)")

The selectors will be substituted transparently this time, but need to be updated at source before next major release. [jlab_core.b207cc5f30e679038452.js:1:1486414](http://localhost:8888/static/lab/jlab_core.b207cc5f30e679038452.js?v=b207cc5f30e679038452)
Starting WebSocket: ws://localhost:8888/api/kernels/cf95fb06-390e-487f-9576-eef379396d0f