[ruby-core:120149] [Ruby master Bug#20940] Colored syntax error from prism

Issue #20940 has been reported by ko1 (Koichi Sasada). ---------------------------------------- Bug #20940: Colored syntax error from prism https://bugs.ruby-lang.org/issues/20940 * Author: ko1 (Koichi Sasada) * Status: Open * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.4 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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](https://no-color.org/)) ---Files-------------------------------- clipboard-202412101454-v5ydy.png (20.6 KB) clipboard-202412101456-u1hrp.png (10.7 KB) -- https://bugs.ruby-lang.org/

Issue #20940 has been updated by matz (Yukihiro Matsumoto). 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. ---------------------------------------- Bug #20940: Colored syntax error from prism https://bugs.ruby-lang.org/issues/20940#change-110957 * Author: ko1 (Koichi Sasada) * Status: Open * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.4 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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](https://no-color.org/)) ---Files-------------------------------- clipboard-202412101454-v5ydy.png (20.6 KB) clipboard-202412101456-u1hrp.png (10.7 KB) -- https://bugs.ruby-lang.org/

Issue #20940 has been updated by mame (Yusuke Endoh). 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. ---------------------------------------- Bug #20940: Colored syntax error from prism https://bugs.ruby-lang.org/issues/20940#change-110968 * Author: ko1 (Koichi Sasada) * Status: Open * Assignee: matz (Yukihiro Matsumoto) * Target version: 3.4 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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](https://no-color.org/)) ---Files-------------------------------- clipboard-202412101454-v5ydy.png (20.6 KB) clipboard-202412101456-u1hrp.png (10.7 KB) -- https://bugs.ruby-lang.org/
participants (3)
-
ko1 (Koichi Sasada)
-
mame (Yusuke Endoh)
-
matz (Yukihiro Matsumoto)