image-to-ascii icon indicating copy to clipboard operation
image-to-ascii copied to clipboard

No colors when running via systemd (no tty)

Open katywings opened this issue 8 months ago • 2 comments

If I run my node server via a systemd service, this breaks the image-to-ascii colors. Using environment variables such as FORCE_COLOR=3 has no effect.

Is this not supported at all or do you know how to make your library work in a non tty environment 🙈?

katywings avatar Apr 06 '25 17:04 katywings

I figured out why FORCE_COLOR=3 isn't working 😅: One of your other packages ansy uses a very old version of supports-color which doesn't have the FORCE_COLOR checks 🙈. Those checks were introduced with supports-color >= 6 (https://github.com/chalk/supports-color/releases/tag/v6.0.0).

https://github.com/IonicaBizau/ansy/blob/fd942e0fd3829367611d3f7e1fbc64c5b4cb8a32/package.json#L31

katywings avatar Apr 06 '25 21:04 katywings

Any contributions for this would be very much appreciated! Thank you very much!

IonicaBizau avatar Apr 11 '25 15:04 IonicaBizau

I've been taking a look at this. I think the change needs to be in ansy. It'll require a bit of refactoring as updating ansy to use supports-color 6.x.x does include breaking changes.

ignoreintuition avatar Oct 08 '25 04:10 ignoreintuition

I think this should be fixed in the last updates. If the issue is still there, please reopen it. 😄

IonicaBizau avatar Oct 14 '25 08:10 IonicaBizau