google/comprehensive-rust

Colored output in the playground console?

Open

#407 建立於 2023年2月14日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Rust (2,009 fork)batch import
good first issuehelp wanted

倉庫指標

Star
 (32,954 star)
PR 合併指標
 (平均合併 9天 23小時) (30 天內合併 36 個 PR)

描述

One selling point of the Rust compiler is colorful error messages that point directly to the problem. However, the embedded playground doesn't illustrate that, because everything becomes monochrome.

While running the course, I occasionally switched to presenting my terminal to illustrate that, but this required some back-and-forth to present a different window, copy-paste the code, run Cargo, etc. This slowed down the course, so I rarely did that.

In principle, there could be a way to take cargo/rustc's colored output, and turn it into suitable HTML/CSS to display the colors in the embedded "console" as well.

貢獻者指南