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

tui: IME preedit (composition) text renders white and is invisible on light themes

Đang mở Phù hợp với người mới
#60,469 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
75/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, frontend

Hướng nghiên cứu

Bắt đầu từ mã nhập liệu của lời nhắc TUI và lần theo đến nơi văn bản soạn trước của IME nhận màu tiền cảnh; issue không nêu tên tệp hay bài kiểm thử. So sánh kiểu hiển thị đó với token text của giao diện và chạy các bài kiểm thử liên quan đến lời nhắc hoặc TUI. Công việc hoàn tất khi văn bản soạn trước vẫn dễ đọc trên giao diện sáng và vẫn được đánh dấu là tạm thời.

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

Mô tả

Description

When typing Chinese with the Microsoft Pinyin IME in the TUI, the preedit / composition string (the pinyin before you confirm it) is rendered in white. On any light theme the prompt background is also light, so the composition text is effectively invisible — you cannot see what you are typing until you press space and the characters are committed.

Committed text is fine (renders in the normal dark text color); only the composition string is affected.

Environment

  • opencode CLI 2.2.0 (opencode-cli.exe, Windows x64, bundled with the desktop app)
  • OS: Windows 11 Insider 10.0.28020
  • Terminal: Windows Terminal 1.25.2733.0
  • Terminal app theme: light, color scheme: VSCode Light Modern (so the terminal's default foreground is already dark — this is not a terminal color-scheme problem)
  • IME: Microsoft Pinyin (default Win11 IME)
  • Reproduced with theme.mode = light and also with the system theme while the terminal is in a light scheme
  • Not reproducible on dark themes (white composition text is visible there)

Steps to reproduce

  1. Put the terminal and opencode in a light theme (theme.name = "one-light" / "github-light" / "catppuccin-latte", or system with a light terminal scheme).
  2. Focus the prompt input.
  3. Switch to a Chinese IME and start typing pinyin, e.g. zhe yang — do not commit yet.
  4. Observe the composition string in the input line.

Expected

The composition string should be readable — ideally using the theme's text color (or a new dedicated token such as textComposition / textPreedit) and optionally an underline to mark it as provisional.

Actual

The composition string is drawn in white (#ffffff-ish), producing near-zero contrast on the light prompt background.

Additional context

  • The theme schema has no token for IME/composition/preedit text. I dumped the full token list from the docs (text, textMuted, background, backgroundPanel, backgroundElement, border*, diff*, markdown*, syntax*) and there is nothing that maps to this element, so a custom theme cannot work around it — the color appears to be hard-coded.
  • Changing the Windows Terminal color scheme to a light one (dark default foreground) does not help, which confirms the color is set by opencode rather than inherited from the terminal.
  • Related but distinct: #55101 (Chinese IME preedit overlaps the prompt placeholder) — same area of the UI, different symptom.

Suggested fix

Use theme.text (or add a textPreedit token defaulting to text) for the composition string instead of a fixed white, and keep the underline as the provisional-state indicator.

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

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.