jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.79k stars 5.01k forks source link

Ctrl+C doesn't copy cell if edit mode previously entered #2763

Open eilamg opened 7 years ago

eilamg commented 7 years ago

Hey

I've noticed weird behavior when trying to Ctrl+C to copy a cell across notebooks. The feature works fine if I've never entered edit mode since re/starting the kernel. But if I enter edit mode even once, hitting Ctrl+C in command mode will instead return me to edit mode in the last edited cell, regardless of current highlighted cell.

Observed in Chrome 60.0.3112.90 (64-bit) on Windows 10 Home and Chrome 60.0.3112.101 (64-bit) on Ubuntu 16.04.

Cheers

takluyver commented 7 years ago

Do you have any browser extensions or Jupyter extensions installed? I can't reproduce this in Chromium or Firefox (testing on Fedora).

eilamg commented 7 years ago

No Jupyter extensions or Chrome extensions.

takluyver commented 7 years ago

Is there anything that might be relevant in the browser's JS console when it jumps back into edit mode?

eilamg commented 7 years ago

Nothing shows up in the console on successful copies or when the issue occurs.


To further complicate things, I did the following:

Which resulted in this interesting combination:

screenshot_2017-08-15_14-22-55

takluyver commented 7 years ago

Which browser were you trying that in? We don't really try to support IE/Edge, but we definitely support Chrome.

eilamg commented 7 years ago

Chrome on Ubuntu (my main workstation). IE and Edge tests were to try and see if this is a Chrome-specific issue.

takluyver commented 7 years ago

And what version of notebook do you have? If you haven't already, can you try installing 5.1rc1:

pip install --upgrade --pre notebook
eilamg commented 7 years ago

I'm running 5.0.0. Just tested with 5.1.0rc1 and managed to reproduce the issue.

takluyver commented 7 years ago

Ah rats, I was hoping it would magically go away. ;-)

I'm running out of ideas for what the difference might be. Is there anything peculiar about your keyboard?

eilamg commented 7 years ago

Some standard QWERTY Logitech wireless keyboard. Just in case, I also tested on the laptop's keyboard with the same results.

There's an RTL language installed, but system locale language is set to en_US.UTF-8.

localectl output below

   System Locale: LANG=en_US.UTF-8
                  LC_NUMERIC=he_IL.UTF-8
                  LC_TIME=he_IL.UTF-8
                  LC_MONETARY=he_IL.UTF-8
                  LC_PAPER=he_IL.UTF-8
                  LC_NAME=he_IL.UTF-8
                  LC_ADDRESS=he_IL.UTF-8
                  LC_TELEPHONE=he_IL.UTF-8
                  LC_MEASUREMENT=he_IL.UTF-8
                  LC_IDENTIFICATION=he_IL.UTF-8
       VC Keymap: n/a
      X11 Layout: us,il
       X11 Model: pc105
     X11 Variant: ,
     X11 Options: grp:alt_shift_toggle,grp_led:scroll
takluyver commented 7 years ago

Another theory bites the dust. I'm out of ideas for now. If you want to dig into the code, the parts that handle the clipboard events are here:

https://github.com/jupyter/notebook/blob/master/notebook/static/notebook/js/clipboard.js

And information on building the JS from source is here:

http://jupyter-notebook.readthedocs.io/en/stable/contributing.html#setting-up-a-development-environment