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

Add experimental support for icy_sixel #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ollbx
Copy link

@ollbx ollbx commented Dec 11, 2024

This adds experimental support for icy_sixel as an alternative for libsixel, guarded by the icy_sixel feature flag.

Why icy_sixel?

  • Pure rust code is much nicer to build using cargo.
  • sixel-sys has issues to build in Windows and seems to be a bit tricky to fix (Windows Terminal Preview supports Sixel).

Other notes:

  • I just used "auto" for all the parameters to icy_sixel and I haven't tested it a ton. So the feature flag should definitely be marked as experimental. It seems to run fine though :-).
  • I moved the code for checking terminal support to a separate sixel_util module, that is compiled, if either sixel or icy_sixel is enabled.
  • I've extended check_sixel_support(), to check for the WT_SESSION environment variable, which is set by Windows Terminal (may not be the best way of detecting it, but seemed to be the simplest change). The code will then just assume true, because running check_device_attrs() was giving me trouble. As a precaution, the if-branch is only compiled in, if icy_sixel is enabled.
  • If both sixel and icy_sixel are enabled, the code will use icy_sixel. This seemed reasonable, as it is the more specific feature flag.

Extending viu to also support the icy_sixel feature flag would be appreciated (should be a trivial pass-through).

So that auto-traits are not negatively affected.
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.

1 participant