-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RGB / 24 bit true color glitching / blinking in macOS terminal.app #475
Comments
Do you know if this Is this just the Rgb colors or all colors? As a side note, looking at the image you're displaying (very cool btw), you might be interested in https://crates.io/crates/ratatu-image by @benjajaja |
Using the new colors example from #476 I am able to repro this: ![]() ![]() |
Raised the issue upstream at crossterm-rs/crossterm#819 |
The root cause is that Terminal.app doesn't support TrueColor. Same problem in Termion. Interestingly Termwiz uses an approach that falls back to an ANSI color on non true color enabled terminals, which is neat. |
Because this is something out of our hands (it would require a fix in Terminal.app, the best we can do with this for now is document it - see #477. Neither Crossterm or Termion expose information on the terminal capabilities to be able to detect if this is a problem, and the Termwiz backend just falls back to the default text color (which is not ideal and perhaps worth fixing if someone wants to do this). Closing this out as wontfix, but there may be other non-obvious approaches to detecting this that could be worth pursuing if you absolutely need this (i.e. manually checking the terminal capabilities and providing the user with an alternative palette). |
Thank you so much for the quick response and figuring this out! I will likely try to use terminfo to query capabilities and then either map true color to what is available or abort with a user understandable message. For context I am building a 3D volumetric viewer for brain imaging / neuroscience. We often want to quickly check what our data looks like on remote clusters and inside containers where we are only connected via a terminal. Ratatui made prototyping this a breeze so thank you and all other conributers a lot! |
If you do want a bit of a head start on this, it's worth taking a look at the termwiz source code. In particular: https://github.com/wez/wezterm/blob/main/termwiz/src/caps/mod.rs |
Seeing the amount of edge cases in this makes me wonder if I should switch to the termwiz backend alltogether until crossterm implements (color) capability querying. But thanks in any case for the pointers! |
Perhaps, but do take note that it hasn't been used anywhere near as much as the other backends, so you're swapping known unknowns for unknown unknowns. |
Issue Status
macOs terminal does not support TrueColor. This will be documented in the
Color::Rgb
docs (as of PR #477)Original issue text:
Description
Colors are not working properly in macOS system terminal. I am using crossterm as a backend.
To Reproduce
Something like this when drawing the buffer
Expected behavior
Instead of showing the correct colors as expected the whole buffer looks weird and blinks (see video below).
Screenshots
This is a video of a ratatui application where most of the buffer is constructed like in the example above.
Screen.Recording.2023-09-08.at.12.13.57.PM.mov
Same terminal with font "SF Mono Regular 11" (System default) so it does not seem to be a font issue
This is what it looks like in ITerm2 on the same machine (and in every other terminal I tried on linux + windows)
Environment
The text was updated successfully, but these errors were encountered: