Skip to content

Conversation

@nbritton
Copy link

@nbritton nbritton commented Sep 30, 2025

Added experimental support for the DEC Sixel standard using sixel_bytes. The font sizes are way super small and lots of other stuff needs further polish, but as a proof of concept, you can now watch YouTube videos with Carbonyl...

nbritton@Mac-mini:~/carbonyl$ CARBONYL_ENV_SIXEL_ONLY=1 CARBONYL_DSF=1 CARBONYL_SIXEL_DITHER=fs ./chromium/src/out/Default/headless_shell "https://www.youtube.com/embed/apg9XR35pAM"

image

…on-and-artifacts

Default sixel mode to non-scrolling output
…ault-method

Default to Sixel rendering with scrolling
…l-terminal-size

Fix Sixel scaling and add Sixel-only rendering mode
…-mode

Default to Sixel rendering and add legacy opt-in
…uild

Fix terminal window update warnings
…nal-pixel-size

Scale SIXEL rendering to terminal geometry
…-with-chromium

Fix SIXEL rendering resolution and palette handling
…nt-not-found-error

Fix sixel diffusion method for new crate version
…hod-and-scale-factor

Fix sixel dithering and enforce integer DSF
…ium-layout

Wire DSF and zoom through bridge
…recent-commit

Handle missing Chromium bridge symbols when building standalone
Fix Chromium patch hunk lengths for zoom integration
Handle leftover git am state in patches script
Comment on lines +96 to +99
// Query graphics capability (XTSMGRAPHICS). Some terminals expect DCS form;
// use it first and fall back to CSI if ignored.
write!(out, "\x1bP?2;1;0S\x1b\\")?;
write!(out, "\x1b[?2;1;0S")?;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, the correct way to determine sixel support is with a DA1 query, and then checking for extension 4 in the response. XTSMGRAPHICS is an Xterm hack to workaround the fact that it can only handle sixel output on a subsection of the screen (i.e. the size reported may be smaller than the actual screen size).

There are other terminals that have implemented XTSMGRAPHICS as well, but it's far from universal, so it's not something you should rely on. And be aware that some terminals may just report a max value for those dimensions, e.g. something like 16384x16384, which doesn't reflect the actual screen size. In any event, the most reliable way to determine the screen size is with the CSI 14 t sequence, which you already seem to be querying anyway.

And not that it matters, but I'm very curious to know which terminal you found that only supported the DCS form of XTSMGRAPHICS. I've never encountered anything like that before.

Comment on lines +185 to +189
if state.scrolling {
write!(self.buffer, "\x1b[?80h")?;
} else {
write!(self.buffer, "\x1b[?80l")?;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at this PR closely enough to understand why you'd need to change this mode either way, but it's worth noting that these values are backwards. When you set mode ?80 you disable sixel scrolling.

That said, I know some terminals have implemented this the wrong way around in the past, and it's possible there are still some with that bug. So if you really need this, it's good that you have it as an option that can be toggled.

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

Successfully merging this pull request may close these issues.

2 participants