crossterm
crossterm copied to clipboard
MacOS terminal not displaying RGB colors correctly
Describe the bug A Ratatui user (@nx10) using crossterm as a backend cut us an issue (https://github.com/ratatui-org/ratatui/issues/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 https://github.com/ratatui-org/ratatui/pull/476 (run cargo run --example colors and hit space)
Expected (iTerm2):
I was able to repro something similar using the Crossterm interactive demo. Here's a screenshot of the blue screen:
To Reproduce Steps to reproduce the behavior:
- Open Mac terminal.app
cd examples/interactive-democargo run- 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:
OS
- Mac
Terminal/Console
- Terminal.app
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.