spinoza icon indicating copy to clipboard operation
spinoza copied to clipboard

Table doesn't display on macOS terminal

Open smu160 opened this issue 1 year ago • 4 comments

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

smu160 avatar Feb 13 '24 21:02 smu160

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.

Screenshot 2024-07-09 at 12 19 40 PM

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

smu160 avatar Jul 09 '24 16:07 smu160

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.

inmzhang avatar Jul 09 '24 23:07 inmzhang

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

inmzhang avatar Jul 10 '24 07:07 inmzhang

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

smu160 avatar Jul 12 '24 20:07 smu160