6/13/2025 at 5:03:04 PM
This looks really cool, I'd like to give it a go. The idea of taking a screenshot of the terminal and then parsing that to determine the true colour support is definitely novel, though perhaps so, because for me I can't get it to work. Are there any debug flags I can enable?So far it was able to take the screenshot correctly (https://ibin.co/8kaRr8TIanv2.png), however the parsing of that fails with the non-descript "Palette parsing failed." error.
Edit: enabled tracing at got this: https://paste.ee/p/ZyNxG9FK
by tfsh
6/13/2025 at 5:45:34 PM
> The idea of taking a screenshot of the terminal and then parsing that to determine the true colour support is definitely novel,A better way to do this is to send `OSC 1 0 ; ? ST` (query foreground color), `OSC 1 1 ; ? ST` (background color), then `OSC 4 ; {n} ; ? ST` where {n} is the nth XTerm color.
See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-O...
by shiomiru
6/13/2025 at 5:53:28 PM
OMG really!? That link is blocked for me for some reason. If that OSC code is widely supported it's going to make things sooooo much easier.by tombh
6/13/2025 at 10:02:05 PM
It’s very widely supported from my experience. This is how asciinema captures terminal palette.by ku1ik
6/13/2025 at 9:15:30 PM
It’s supported by any xterm compatible terminal emulator. But like with most things in this domain, expect plenty of edge cases where it should work but doesn’t.by hnlmorg
6/13/2025 at 5:52:22 PM
Thanks for trying it out. It looks like either your terminal or screenshotter isn't faithfully rendering the pure red marker column (it's needed for calibration in the parser). The red should be #ff0000, but the screenshot is using #ea3323. I've made a Github issue to keep track https://github.com/tattoy-org/tattoy/issues/98 If you can add more details it'd really useful, I'm sure there'll be more people like you.by tombh
6/14/2025 at 11:03:43 AM
Maybe that's night mode (or whatever your DE calls it)?by mkesper
6/14/2025 at 12:29:17 PM
Interesting, I'd never thought of that.by tombh