-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add copy and paste commands to terminal context menu #13535
Add copy and paste commands to terminal context menu #13535
Conversation
Thanks for making a pull request to jupyterlab! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @krassowski
Do you have time to make the backport this week. I'll like to get a beta out this week for 3.6; so we can focus on 4.0.0?
@meeseeksdev please backport to 3.6.x
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
… context menu (cherry picked from commit 43f4428)
… context menu (cherry picked from commit 43f4428)
… context menu (cherry picked from commit 43f4428)
… context menu (cherry picked from commit 43f4428)
Thanks for the heads-up. No paste is a bit disappointing 😢 From the link you posted it seems you also need to opt-in to the read feature on Firefox: |
References
Closes #3011
Re-uses the same interface to Clipboard API that we use in
FileEditor
's context menu for over two years now (#8425, JupyterLab 2.2).Code changes
ITerminal
interface:getSelection
,hasSelection
andpaste
following the underlying naming ofxterjm.js
implementationTerminal
by passing them over toxterm.js
methodsterminal:paste
andterminal:copy
User-facing changes
When pasting for the first time the browser may (depending on browser/settings) ask for confirmation to allow access to the clipboard:
All the caveats of this not working if browser restricts Clipboard API apply, see browser compatibility table.
For example, Firefox does not permit copy in non-secure contexts (
https
is ok) and does not allow paste at all. This is also the case for file editor, so this is not new. Ideally we would detect support and disable the command if support is not available but this is tricky for browsers which allow support after user consent.Backwards-incompatible changes
Adds new non-optional methods to the interface.
If would like to backport to 3.6 if time permits, making the new methods optional in backport (but required for 4.0).