Skip to content
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

MacOS terminal not displaying RGB colors correctly #819

Closed
joshka opened this issue Sep 9, 2023 · 2 comments
Closed

MacOS terminal not displaying RGB colors correctly #819

joshka opened this issue Sep 9, 2023 · 2 comments

Comments

@joshka
Copy link
Collaborator

joshka commented Sep 9, 2023

Describe the bug
A Ratatui user (@nx10) using crossterm as a backend cut us an issue (ratatui/ratatui#475) about macOS terminal rendering RGB colors incorrectly (with blinking). This seems to be an upstream problem rather than one in Ratatui.

I'm unsure whether this is a Terminal.app bug (and hence perhaps the remedy is to document it as an unsupported platform while submitting the issue to Apple for a fix) or a Crossterm bug.

My example code to repro this is in ratatui/ratatui#476 (run cargo run --example colors and hit space)
image
Expected (iTerm2):
image

I was able to repro something similar using the Crossterm interactive demo. Here's a screenshot of the blue screen:
image

To Reproduce
Steps to reproduce the behavior:

  1. Open Mac terminal.app
  2. cd examples/interactive-demo
  3. cargo run
  4. Select colors, and hit space 5 times to get to the blue values demo (the red and green channels also render incorrectly, but don't blink)

Expected behavior
The following is the blue screen rendered in iTerm2:
image

OS

  • Mac

Terminal/Console

  • Terminal.app
@joshka
Copy link
Collaborator Author

joshka commented Sep 9, 2023

Actually, this affects termion too (and termwiz seems to fallback to ansi colors), so it's just Terminal.app not supporting true color:
https://discussions.apple.com/thread/250459018
https://discussions.apple.com/thread/250636611

So perhaps this can really just be handled with docs.

Interestingly the approach that Termwiz uses for this is to fallback to an ANSI color on non true color enabled terminals, which is neat.

@joshka
Copy link
Collaborator Author

joshka commented Nov 10, 2024

Closing this out as the problem is that Terminal.app does not support RGB colors and it's not something that crossterm can reasonably fix. It's likely that apps need to detect support for RGB and then act accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant