You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Yes, I would love to have color output in the playground — the output is probably without color because the compiler detects that stdout is not connected to a terminal. A simple CARGO_TERM_COLOR=always (or the equivalent for rustc) would probably help here. We would then need to translate the ANSI color codes to HTML, but there are libraries for that.
The issues here is related to rust-lang/rust-playground#879, though that issue seems to be mostly about allowing the programs to output colored text. I created rust-lang/rust-playground#900 upstream to track the issue of keeping colors in the compiler error messages.
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.
The text was updated successfully, but these errors were encountered: