Clipboard copy in code-server on iPad is unreliable with dragged/keyboard selections
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript, vscode
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện các bước kéo để chọn, sao chép và dán trong code-server trên iPadOS qua các trình duyệt được liệt kê, so sánh việc chọn từ cuối đến đầu và từ đầu đến cuối bằng các thao tác nhấp đúp và nhấp ba. Truy vết đường đi của clipboard trên trình duyệt được VS Code web editor sử dụng; hoàn thành khi các vùng chọn bất kỳ luôn đến được clipboard của iPad, giữ nguyên dấu ngắt dòng và không bị chuyển thành URL-encoded.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- iPadOS: 26.0.1
- code-server: 4.105.1 (
811ec6c1d60add2eb92446161ca812828fdbaa7f) - VS Code (web): 1.105.1
- Browsers on iPad: Safari, Safari PWA (Add to Home Screen), Brave, Chrome
- Access: Tailscale with HTTPS (valid certs; no warnings)
- Host: code-server running in WSL2 on Windows 11 (Ubuntu)
Steps to Reproduce
- Open code-server in Safari
- Open a file (I used
.py) - Select code by dragging with mouse/trackpad from end to beginning
- Press ⌘C to copy.
- Press the position you want to paste
- Press ⌘V to paste.
Note on selection direction: If I select from the beginning to the end of the text, copy tends to work more often, but I then hit separate encoding issues (details below). If I select from the end to the beginning (which is common in real use), copy fails much more frequently. Details and diagnostics are in later sections.
Expected
Copy should reliably place the selected text into the iPad system clipboard, regardless of how the selection was created. Pasting should paste the just selected text.
Actual
The pasted text is often not the selection; it pastes whatever was previously on the clipboard.
Because this is intermittent, try the above a few times if it works once; failures are common but not 100%.
Logs
When selecting text (end to beginning), pressing **⌘C** (fails), and pasting (pasted previously copied text, not the new text):
[18:36:01] File action: writeFile /mnt/c/Users/<user>/<working_directory_path>/temp.py
[18:36:01] [File Watcher (node.js)] [raw] ["change"] temp.py
[18:36:01] [File Watcher (node.js)] [CHANGED] /mnt/c/Users/<user>/<working_directory_path>/temp.py
[18:36:01] [File Watcher (node.js)] >> ignored (not included) /mnt/c/Users/<user>/<working_directory_path>/temp.py
[18:36:01] [File Watcher (node.js)] [raw] ["change"] temp.py
[18:36:01] [File Watcher (node.js)] [CHANGED] /mnt/c/Users/<user>/<working_directory_path>/temp.py
[18:36:01] [File Watcher (node.js)] >> ignored (not included) /mnt/c/Users/<user>/<working_directory_path>/temp.py
[18:36:01] [File Watcher ('parcel')] [CHANGED] /mnt/c/Users/<user>/<working_directory_path>/temp.py
[18:36:01] File action: writeFile /home/<user>/.local/share/code-server/User/History/-5a5bb3a7/entries.json
[18:36:01] [File Watcher ('parcel')] [CHANGED] /mnt/c/Users/<user>/<working_directory_path>/temp.py
[18:36:01] [File Watcher ('parcel')] >> normalized [CHANGED] /mnt/c/Users/<user>/<working_directory_path>/temp.py
Screenshot/Video
https://github.com/user-attachments/assets/defdc0fb-6442-484e-a772-f1914b6b16e7
Does this bug reproduce in native VS Code?
This cannot be tested in native VS Code
Does this bug reproduce in GitHub Codespaces?
I did not test GitHub Codespaces
Are you accessing code-server over a secure context?
- I am using a secure context.
Notes
Additional observations
A) Selection direction vs. encoding artifacts
- Selecting begin → end tends to copy more reliably (always so far), but small selections that include certain punctuation (quotes, commas, colons) can paste as URL‑encoded text.
- Code line:
print("Torch version:", torch.__version__) - Example selected:
n:", to - Pasted:
n:%22,%20to
- Code line:
- When selecting larger spans or multiple lines, the URL‑encoding doesn’t appear.
- When pasting multiple lines that were copied during these “encoded” cases, they paste as one line instead of preserving line breaks.
B) Selection method that always works (diagnostic)
- If I select by double-click (word) or triple-click (entire line) and then copy, copy/paste always works and I do not see the encoding issue.
- This is useful as a control, but it’s not how users typically select arbitrary ranges in day-to-day editing.
What I’ve tried
Copy mechanisms
- ⌘C / ⌘V (default) → unreliable with drag/Shift+Arrow selections.
- right‑click → Copy → same behavior.
Keybindings
- Custom binding of
editor.action.clipboardCopyActionto Ctrl+Shift+C → still unreliable with drag selections. - Default ⌘C left in place to match typical usage; same results.
Browsers
- Safari, Safari PWA, Brave, Chrome on iPad → identical behavior (expected; all are WebKit).
Selection variants
- End → begin selection → fails more frequently.
- Begin → end selection → succeeds always (in the short time I've tried it), but introduces URL‑encoded paste for short spans containing punctuation.
- Double/triple‑click selection → always succeeds, no encoding issue.
- Multiple lines / larger blocks → encoding issue not observed.
Impact
Frequent copy failures and occasional encoding artifacts make normal editing (moving code, refactoring snippets, copying short substrings) unreliable on iPad. The Begin → end selection is a usable workaround for now, and for the encoding issue I can select more text and delete the extra parts, but it does impact my productivity.
On a side note, this is my first issue on a public repository, so feedback on what I could do differently in the future is always welcome :)
- Ngôn ngữ chính
- TypeScript
- Star
- 79.4k
- Fork
- 6.9k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 39
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/code-server
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
coder/code-server#8017 · 2 bình luận ·
-
Bump proxy-addr to 2.0.8 Đang mởsecurity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
coder/code-server#8013 · 4 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
coder/code-server#7976 · 2 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
coder/code-server#7962 · 3 bình luận ·
-
bug needs-investigation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
coder/code-server#7955 · 1 bình luận ·
Tất cả issue của coder/code-server
Issue tương tự
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Đang mởclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
supermomonga/zcode-acp#24 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
growthbook/growthbook#7100 ·
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100