Bug #20940
closedColored syntax error from prism
Description
Prism shows syntax error with coloring.
But we have long avoided coloring Ruby for reasons such as color weakness.
Can we release next Ruby 3.4.0 with colored syntax errors?
NOTE:
- irb supports
NO_COLOR
environment variable (NO_COLOR: disabling ANSI color output by default)
Files
Updated by matz (Yukihiro Matsumoto) 7 days ago
I personally prefer coloring error output, but for some reason, users may want to stop coloring. It should honor NO_COLOR
environment variable to stop coloring.
Matz.
Updated by mame (Yusuke Endoh) 7 days ago
Personal opinion on terminal coloring (or any escape sequences). Colors should be completely optional as information because colors are not subject to copy and paste in today's standard environment. I don't think Prism currently violates this, but I would ask you to make sure that it never violates this.
The reason for this is partly because of the colorblindness issue that ko1 mentions, but also because it would damage the Ruby ecosystem.
If copying and pasting text reduces information, people will start asking questions on stackoverflow, etc. with screenshots instead of text. Then error messages will no longer be subject to string searches. This would make it difficult to search for the information on Google or in a browser. In the future, when Google search, browsers, and ChatGPT or something, all support OCR by default, this limitation could be relaxed, but for the time being, terminal output must be complete as a text.
Updated by nobu (Nobuyoshi Nakada) 4 days ago
- Status changed from Open to Closed
Applied in changeset git|5c372969ad65a5b5a329cc591daac7030a2eccc5.
[Bug #20940] [PRISM] Support NO_COLOR
Also use bold/faint SGR when possible.