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

Copy/paste of cells across notebooks doesn't work #2392

Closed
peter-ch opened this issue Apr 10, 2017 · 10 comments
Closed

Copy/paste of cells across notebooks doesn't work #2392

peter-ch opened this issue Apr 10, 2017 · 10 comments

Comments

@peter-ch
Copy link

I'm using the latest Jupyter notebook on Ubuntu 16.04 x64 with Chrome. When I click "Copy cells" in one notebook, it doesn't let me paste them in another. I thought the latest notebook has this feature, but it behaves just like the older version.

@gnestor
Copy link
Contributor

gnestor commented Apr 10, 2017

I have also encountered this...

@takluyver Can you verify whether it's working for you on 5.0.0?

#1286

@takluyver
Copy link
Member

To use the system clipboard and move cells between notebooks, you need to use Ctrl-(x/c/v), or their Cmd- equivalents on a Mac. The UI buttons and the x/c/v shortcuts still use our Javascript clipboard, which only works within the notebook. This is a browser limitation - we can only access the system clipboard when we're handling a native clipboard event.

I suspect that I'm going to be explaining the two clipboards issue for many years. I'll turn this into a saved reply on Github.

@dsblank
Copy link
Member

dsblank commented Apr 11, 2017

This is a really confusing point. Surely some other things can be done, short of resolving the distinction? Change the UI? Remove the non-clipboard versions? Give a popup message the first time? We all are going to be attempting to explain this point for many years.

@takluyver
Copy link
Member

Change the UI?

To what? ;-)

Remove the non-clipboard versions?

I hope that will eventually make sense, but at present I don't have enough confidence that the system clipboard mechanism works in all situations to drop the JS clipboard that's already well tested. And when we do, we'll be answering 'where did my clipboard buttons go?'

Give a popup message the first time?

Myeh. Messages that pop up while you're trying to do something are irritating, most users close them without really reading them, and it's tricky to reliably track whether we've shown a one-off message before.

I hope we can find a way to make it easier to understand, but at the moment I can't think of anything that really seems like an improvement. Except for making desktop apps like nteract, to avoid the limitations of the browser.

@peter-ch
Copy link
Author

Thanks, Ctrl-C / V worked. It's not that I needed it so much (as just copying/pasting the text from the cells already does the job), but I thought it's a bug that slipped through.

@gnestor
Copy link
Contributor

gnestor commented Apr 13, 2017

I observed that copying/pasting a cell using the command palette does work across notebooks.

@takluyver
Copy link
Member

That's... surprising. 😕

@gnestor
Copy link
Contributor

gnestor commented Apr 18, 2017

I observed that copying/pasting a cell using the command palette does work across notebooks.

That is, does not work across notebooks.

@takluyver
Copy link
Member

Aha, that's what I'd expect. Again, we can only use the system clipboard when handling a clipboard event, and we can't trigger a clipboard event programmatically.

@takluyver
Copy link
Member

Closing this because there's no clear fix we can make. I'm happy to keep discussing possible improvements, but so far I've not found any workable solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants