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

(Web, Safari) Copying and pasting line with colon and no leading space results in URL encoding of pasted text #235666

Open
keithporcaro opened this issue Dec 9, 2024 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-clipboard Editor clipboard issues help wanted Issues identified as good community contribution opportunities ios-ipados

Comments

@keithporcaro
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: Web
  • OS Version: iPadOS 18.1 (Safari)

VSCode Web on iPadOS/Safari appears to be erroneously encoding certain copied text as a URL.

So copying this string of text from a VSCode Web file:
foo: bar

And pasting it into another VSCode web file will result in:
foo:%20bar

This is only the case if there isn’t a space before the colon anywhere on the line. So,
foo: bar and foo bar: baz both copy and paste normally.

This also only happens within VSCode web. So, copying foo: bar from an external app and pasting it into VSCode Web or copying foo: bar from VSCode web into another app both work fine.

I have not been able to reproduce this on VSCode Web on Mac or Windows.

Steps to Reproduce:

  1. On iPadOS on Safari, open a new file on VSCode Web (or Github Codespaces)
  2. Write text foo: bar
  3. Copy to clipboard, where the first character of selection is NOT whitespace
  4. Paste into same file.
ScreenRecording_12-09-2024.12-30-07_1.mov
@joyceerhl
Copy link
Collaborator

I am unable to reproduce this behavior in Safari on macOS with vscode.dev, do you happen to have an extension installed that might be interfering here?

@joyceerhl joyceerhl assigned mjbvz and unassigned joyceerhl Dec 11, 2024
@keithporcaro
Copy link
Author

I noted this in the original issue: it’s only on iPadOS (and iOS) safari. I’m not seeing the issue on Mac either. I see it without any extensions installed—also reproduced on VSCode.dev in a clean private browsing session.

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Dec 12, 2024
@mjbvz
Copy link
Collaborator

mjbvz commented Dec 12, 2024

Seems to happen on copy as you can also paste the wrong content into other apps

@mjbvz mjbvz added ios-ipados help wanted Issues identified as good community contribution opportunities bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Dec 12, 2024
@mjbvz
Copy link
Collaborator

mjbvz commented Dec 12, 2024

For anyone investigating, it seems fixed if you set "editor.pasteAs.enabled": false

That means a good place to start is likely the copy paste controller:

private handleCopy(e: ClipboardEvent) {

@mjbvz mjbvz added the editor-clipboard Editor clipboard issues label Dec 12, 2024
@uvguy
Copy link

uvguy commented Dec 19, 2024

this issue relate to this coder/code-server#7116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug editor-clipboard Editor clipboard issues help wanted Issues identified as good community contribution opportunities ios-ipados
Projects
None yet
Development

No branches or pull requests

5 participants