microsoft / microsoft/TypeScript
Some colors make error messages hard to read on white backgrounds.
- 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:
### 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:
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