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

Force colors without forcing the style? #474

Closed
toonn opened this issue Mar 6, 2023 · 8 comments
Closed

Force colors without forcing the style? #474

toonn opened this issue Mar 6, 2023 · 8 comments

Comments

@toonn
Copy link

toonn commented Mar 6, 2023

In ranger/ranger#2762 a user was trying to make use of Glow for Markdown previews and they didn't see any change so they assumed it didn't work.

Does Glow disable colors when run non-interactively, like ls does? Or is there a failing check for color capability maybe? What does Glow need to determine colors are OK to use?

@muesli
Copy link
Contributor

muesli commented Mar 6, 2023

Indeed, it disables styling when not attached to a terminal. Internally it uses termenv to detect the capabilities and settings of the terminal. You can enforce styling by either setting CLICOLOR_FORCE to 1 or passing a style manually, e.g. glow -s dark.

@muesli muesli closed this as completed Mar 6, 2023
@toonn
Copy link
Author

toonn commented Mar 6, 2023

Would be nice if this was more obviously documented BTW. It seems Glow is missing a man page altogether?

@suchipi
Copy link

suchipi commented Apr 10, 2023

Fwiw, glow 1.5.0 on macOS doesn't seem to respect CLICOLOR_FORCE=1, but manually specifying a style does work.

@toonn
Copy link
Author

toonn commented Apr 10, 2023

@suchipi, I thought I'd noticed this regressing. Did it never work on macOS or is it really a regression in the behavior?

@suchipi
Copy link

suchipi commented Apr 11, 2023

Not sure; hadn't tried glow before yesterday

@suchipi
Copy link

suchipi commented Apr 12, 2023

CLICOLOR_FORCE doesn't seem to work even on Linux (I tested glow 1.5, 1.4.1, 1.4.0, 1.1.0, 0.2.0, and 0.1)

@toonn
Copy link
Author

toonn commented Apr 13, 2023

I know it worked at some point for me. Maybe it's because of a dependency?
@muesli, could you take a look at this?

@meowgorithm
Copy link
Member

Just a note that we're discussing the issue here: #654

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

No branches or pull requests

4 participants