code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: Some strings that contain colon(:) get converted to a link when copied on iPad

Open 54wedge opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: Safari
  • Local OS: iPadOS 17.3
  • Remote OS: MacOS 12.6
  • Remote Architecture: x86
  • code-server --version: 4.20.1

Steps to Reproduce

  1. Start code-server
  2. Access code-server on iPad
  3. Copy a line of code with double colon and certain characters before it. eg.fmt::print(“hello”);

Expected

The copy and paste work correctly.

Actual

Code Result
fmt::print(“Hello world”); fmt:%3Aprint(%22Hello%20world%22);
t::print(“Hello world”); t:%3Aprint(%22Hello%20world%22);
::print(“Hello world”); ::print("Hello world");
_::print(Hello world); _::print("Hello world");
_fmt::print("Hello world"); _fmt::print("Hello world");

( _ represents a space)

Logs

No response

Screenshot/Video

https://github.com/coder/code-server/assets/20142690/da8b1eb2-edf9-49bf-af5b-d24f15743694

Does this issue happen in VS Code or GitHub Codespaces?

  • [ ] I tested this in native VS Code.
  • [ ] This does not happen in native VS Code.
  • [X] I tested this in GitHub Codespaces.
  • [ ] This does not happen in GitHub Codespaces.

Are you accessing code-server over a secure context?

  • [X] I am using a secure context.

Notes

Copy works flawlessly in Safari on MacOS 12.6.

54wedge avatar Feb 03 '24 03:02 54wedge

I investigated a little deeper and it seems that strings containing certain alphanumeric characters and a single colon can not be copied correctly as well. (eg.default:{}—>default:%7B%7D) Pasting the code into apple notes shows that the copied string is converted to a link somehow.

54wedge avatar Feb 03 '24 08:02 54wedge

If this happens in Codespaces definitely raise it upstream so they can fix it there! https://github.com/microsoft/vscode

code-asher avatar Feb 05 '24 19:02 code-asher

Yeah. I figured that out. I will try to make a more detailed post there.

54wedge avatar Feb 07 '24 02:02 54wedge