Table doesn't display on macOS terminal
Table does not display neither the ampltiude bars, nor the probability bars when running on macOS terminal.
The to_table utility function produces a tabular format visualization of the state. One can see an example of this by running:
cargo run --release --example h -- -q 3 -t 1 -p
To reproduce this issue, re-run the aforementioned command using macOS terminal.
Tested on the following system config:
| OS | macOS Sonoma 14.3.1 |
| terminal | Version 2.14 |
Hi @inmzhang,
Thank you for tackling this issue! The issue with the table exists on the macOS native terminal. I just pulled your changes, and the lack-of-color issue still exists. Please see the attached screenshot.
The issue seems to be the colors not being supported, or something to that effect. This may also be terminal config issue. Personally, I use wezterm, so I haven't run into this issue otherwise.
Best, Saveliy
I only tested it on Linux with the Kitty terminal and assumed it would work. I'll look into it and test it on my Mac to see if I can resolve the issue.
Hi Saveliy, the comfy_table::Color::Rgb used "RGB color model" that requires the terminal has Truecolor support. And the default terminal on Mac does not satisfy^1.
A possible solution is to use comfy_table::Color::AnsiValue instead, which only requires 256-color support. However, I think it's fine to keep this Truecolor-terminal-only constraint and note it in the documentation.
Best, Yiming
Hi @inmzhang,
Thank you for your hard work! I agree that we can specify the limitation to Truecolor-terminal-only. I'll create a PR for this.
Best, Saveliy