microsoft / microsoft/TypeScript

Some colors make error messages hard to read on white backgrounds.

Đang mở Phù hợp với người mới
#63,648 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Awaiting More Feedback Suggestion
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

On a terminal with white background, some parts of the error messages are very hard to read:

Image

### Cause

The problem is that the `diagnosticwriter` is forcing the [bright versions of the colors](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Pm-m:Ps-=-9-0.1E5F), instead of using the default colors set by the terminal configuration (by writing `9x` instead of `3x`):

https://github.com/microsoft/typescript-go/blob/168e7015edf98244febc8f4ae450b673b5d195d7/internal/diagnosticwriter/diagnosticwriter.go#L108-L112

If I patch the binary to replace the colors to `3x` with this:

```
$ sed -i 's/\x1b\[9\(.\)m/\x1b[3\1m/g' ./node_modules/@typescript/typescript-linux-x64/lib/tsc
```

Then the output is much easier to read:

Image

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu tại internal/diagnosticwriter/diagnosticwriter.go, ở phần mã ghi màu được liên kết trong issue, và so sánh các chuỗi terminal mà nó phát ra với hành vi được báo cáo trên nền trắng. Xác minh đầu ra chẩn đoán trong một terminal bằng cách sử dụng màu mặc định của terminal; được coi là hoàn tất khi các thông báo lỗi vẫn dễ đọc mà không buộc phải dùng các biến thể màu sáng.

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

Đánh giá

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

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.