ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:120149] [Ruby master Bug#20940] Colored syntax error from prism
@ 2024-12-10  6:01 ko1 (Koichi Sasada) via ruby-core
  2024-12-12  7:17 ` [ruby-core:120198] " matz (Yukihiro Matsumoto) via ruby-core
  2024-12-12 10:26 ` [ruby-core:120205] " mame (Yusuke Endoh) via ruby-core
  0 siblings, 2 replies; 3+ messages in thread
From: ko1 (Koichi Sasada) via ruby-core @ 2024-12-10  6:01 UTC (permalink / raw)
  To: ruby-core; +Cc: ko1 (Koichi Sasada)

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?

![colored_syntax_error1](clipboard-202412101454-v5ydy.png)
![colored_syntax_error2](clipboard-202412101456-u1hrp.png)

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/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:120198] [Ruby master Bug#20940] Colored syntax error from prism
  2024-12-10  6:01 [ruby-core:120149] [Ruby master Bug#20940] Colored syntax error from prism ko1 (Koichi Sasada) via ruby-core
@ 2024-12-12  7:17 ` matz (Yukihiro Matsumoto) via ruby-core
  2024-12-12 10:26 ` [ruby-core:120205] " mame (Yusuke Endoh) via ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: matz (Yukihiro Matsumoto) via ruby-core @ 2024-12-12  7:17 UTC (permalink / raw)
  To: ruby-core; +Cc: matz (Yukihiro Matsumoto)

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?

![colored_syntax_error1](clipboard-202412101454-v5ydy.png)
![colored_syntax_error2](clipboard-202412101456-u1hrp.png)

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/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:120205] [Ruby master Bug#20940] Colored syntax error from prism
  2024-12-10  6:01 [ruby-core:120149] [Ruby master Bug#20940] Colored syntax error from prism ko1 (Koichi Sasada) via ruby-core
  2024-12-12  7:17 ` [ruby-core:120198] " matz (Yukihiro Matsumoto) via ruby-core
@ 2024-12-12 10:26 ` mame (Yusuke Endoh) via ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2024-12-12 10:26 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

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?

![colored_syntax_error1](clipboard-202412101454-v5ydy.png)
![colored_syntax_error2](clipboard-202412101456-u1hrp.png)

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/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-12 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-10  6:01 [ruby-core:120149] [Ruby master Bug#20940] Colored syntax error from prism ko1 (Koichi Sasada) via ruby-core
2024-12-12  7:17 ` [ruby-core:120198] " matz (Yukihiro Matsumoto) via ruby-core
2024-12-12 10:26 ` [ruby-core:120205] " mame (Yusuke Endoh) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).