Project

General

Profile

Actions

Bug #20940

closed

Colored syntax error from prism

Added by ko1 (Koichi Sasada) 9 days ago. Updated 4 days ago.

Status:
Closed
Target version:
[ruby-core:120149]

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?

colored_syntax_error1
colored_syntax_error2

NOTE:


Files

clipboard-202412101454-v5ydy.png (20.6 KB) clipboard-202412101454-v5ydy.png ko1 (Koichi Sasada), 12/10/2024 05:54 AM
clipboard-202412101456-u1hrp.png (10.7 KB) clipboard-202412101456-u1hrp.png ko1 (Koichi Sasada), 12/10/2024 05:56 AM

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.

Actions #3

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.

Actions

Also available in: Atom PDF

Like1
Like0Like0Like0