Add --color/-c flag to force ANSI output when piping #943
Closed
martinpovolny
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
I am not familiar with ranger, that said, this seems to work fine when testing with ranger: CLICOLOR_FORCE=1 glow --style dark "${FILE_PATH}"For more information on how glow determines this behind the scenes, and what other standard env vars are respected: https://github.com/charmbracelet/colorprofile/blob/357d532ad87532edd6a89d578b37023c43970f82/env.go#L56-L69 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am running glow from ranger -- https://github.com/ranger/ranger
I am suggesting to add a flag:
--color/-cto force ANSI output when pipingFor that I needed to force color output even piping the output.
Above is a screenshot of the resulting behavior.
Below is the configuration fragment for ranger
Here's a branch for reference: https://github.com/martinpovolny/glow/tree/feat/color-flag
Does that make sense for a wider publicum? Shall I make a PR or do you suggest to refine the feature somehow?
Thanks and regards.
Beta Was this translation helpful? Give feedback.
All reactions