Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Local copy writes the clipboard natively and via OSC 52 at once, racing the terminal (macOS)

Đang mở Phù hợp với người mới
#59,052 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
cli

Hướng nghiên cứu

Tìm thao tác ghi vào clipboard của TUI sử dụng đích “all-available” và đọc cách dịch vụ clipboard xử lý “best-available” cho các phiên cục bộ và từ xa. Thay đổi hành vi sao chép của TUI để tránh các lần ghi cục bộ đồng thời, đồng thời giữ nguyên OSC 52 cho SSH. Kết quả cần đạt là các lần sao chép cục bộ lặp lại không còn kích hoạt cảnh báo của Alacritty và các lần sao chép từ xa vẫn sử dụng OSC 52.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

Since upgrading from 1.18.30 to 2.1.4, copying text in the TUI often makes Alacritty show:

[WARN] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false

The TUI's clipboard write uses destination: "all-available", which starts the in-process host write and emits OSC 52 at the same moment. Locally, the terminal then writes the same pasteboard concurrently, and one of the two writes is rejected. The text still lands, but the terminal shows the warning.

1.18.30 also did both, but OSC 52 went first and the native write was a spawned osascript, so the two never overlapped.

The clipboard service already has "best-available" (host first, OSC 52 only if the host write fails or the session is remote). Using that for TUI copies would keep OSC 52 for SSH, where it's needed, and avoid the double write locally.

Plugins

@tarquinen/opencode-dcp, plus two local plugins (none touch the clipboard)

OpenCode version

2.1.4 (Homebrew)

Steps to reproduce
  1. Run opencode in Alacritty on macOS (default terminal.osc52 = "OnlyCopy"), not over SSH.
  2. Select text to copy, a few times.
  3. Alacritty intermittently shows the warning above.
Operating System

macOS 27.0.1

Terminal

Alacritty 0.17.0

Ngôn ngữ chính
TypeScript
Star
221k
Fork
29.6k
Merge trung bình
5 giờ 22 phút
Pull request đã merge (30 ngày)
531

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.