-
-
Notifications
You must be signed in to change notification settings - Fork 319
Added experimental support for DEC Sixel using sixel_bytes. #206
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
base: main
Are you sure you want to change the base?
Added experimental support for DEC Sixel using sixel_bytes. #206
Conversation
…el-standard Add Sixel rendering support
…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
Fix bridge component dependencies
Fix default zoom without zoom component dependency
…issue Break Skia bridge dependency cycle
…move-deprecated-modes Remove legacy rendering modes
Restore repository to PR #11 state
| // 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")?; |
There was a problem hiding this comment.
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.
| if state.scrolling { | ||
| write!(self.buffer, "\x1b[?80h")?; | ||
| } else { | ||
| write!(self.buffer, "\x1b[?80l")?; | ||
| } |
There was a problem hiding this comment.
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.
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"