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 and Cut to Clipboard not working in Safari or App Containers like Unite/Fluid #569

Closed
TomFrost opened this issue Apr 23, 2019 · 13 comments
Labels
bug Something isn't working

Comments

@TomFrost
Copy link

  • code-server version: 1.939-vsc1.33.1
  • OS Version: Ubuntu 18.04 LTS
  • Safari Version: 12.1 on macOS Mojave

Description

When using Safari or any application container that uses Safari as the engine (such as those generated by Unite or Fluidapp -- my favorite way to use code-server), highlighting text and pressing Cmd+C, Cmd+X, or choosing "Copy" or "Cut" from the Edit menu has no effect. Pasting after doing any of those things results in the previous contents of the clipboard being pasted. Chrome does not have this issue.

Steps to Reproduce

  1. Copy text to your clipboard from any text file or website outside of code-server
  2. Open code-server in Safari and highlight text in an open file
  3. Press Cmd+C
  4. Press Cmd+V. The text copied in Step 1 will be pasted.

Thanks for this incredible project!

@TomFrost TomFrost added the bug Something isn't working label Apr 23, 2019
@TomFrost
Copy link
Author

Playing around with different releases, this commit last night seems to be the culprit: 2bc6e1a

@TomFrost TomFrost changed the title Copy and Cut to Clipboard not working in Safari Copy and Cut to Clipboard not working in Safari or App Containers like Unite/Fluid Apr 25, 2019
@BaileyJM02
Copy link

Any update on a release date for this fix?

@niemyjski
Copy link

I'm also running into this and it's pretty annoying.

@BaileyJM02
Copy link

I managed to downgrade with out any problems - just use the same settings and execute the older build file. It’s not broken on the version below :)

I haven’t updated to the newer version yet as i’m sure this bug still exists.

@drewcovi
Copy link

Any workarounds for this in the short-term?

@BaileyJM02
Copy link

Long-term is downgrade to the version prior to this commit: 2bc6e1a I mean you can always use another browser but I haven’t seen anything related to this within any commits yet.

drewcovi referenced this issue Jun 10, 2019
StackOverflow will be useful again.
@code-asher
Copy link
Member

So it's the copying that doesn't work while the paste works fine?

We try to use the clipboard API if navigator.clipboard exists (we call navigator.clipboard.writeText()). If permission has been denied it will fail silently (we need to add an error popup message for this).

If navigator.clipboard doesn't exist it inserts the text to copy into an input then runs execCommand("copy"). We should show a message when that fails, too.

@code-asher
Copy link
Member

code-asher commented Jun 10, 2019

Additionally, if permission has been denied we should fall back to the execCommand method (for both copy and paste).

@drewcovi
Copy link

Yeah i didn’t have a lot of time to dig that deep, but suffice to say, regardless of what’s supported, the current implementation results in a broken copy (as in I can’t even copy out of the editor to a notepad)

@BaileyJM02
Copy link

BaileyJM02 commented Jun 21, 2019

@code-asher I also get some errors such as:
image
when using the last version before copy and paste was broken.

Any update on progress? Really wanna update to see if it fixes the memory hog issue.

@NGarate
Copy link

NGarate commented Jul 6, 2019

I have the save issue on IpadOS 13. With version 1.1156-vsc1.33.1. Can not copy or cut anything.

admvx added a commit to admvx/code-server that referenced this issue Jul 12, 2019
Allows clipboard to function as expected on iPadOS beta.

Resolves coder#569
@admvx
Copy link
Contributor

admvx commented Jul 12, 2019

Just for iPadOS, I wanted to share a hack I've been using locally to achieve full clipboard functionality (please see the commit linked above).

Maybe it will be useful to anyone similarly desperate to access code-server on an iPad, but unfortunately in its current form it isn't pull-request appropriate. It's the best I could manage via editing the patch file by hand.

@code-asher
Copy link
Member

The copy/paste mechanism in question has been entirely replaced with v2 so I'm going to close this. The only clipboard issues I'm aware of now are #1106 and #1015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants