charmbracelet / glow

Render markdown on the CLI, with pizzazz! 💅🏻
MIT License
16k stars 349 forks source link

fix: pass color profile down to glamour #626

Closed caarlos0 closed 2 months ago

caarlos0 commented 2 months ago

glamour was ignoring the detected color profile when running glow file.md

folliehiyuki commented 2 weeks ago

Sorry to bother you, @caarlos0 ! This commit breaks the workflow of using glow as Markdown previewer inside terminal file managers. termenv probably determines the preview pane being a non-terminal output (which makes sense though).

Can glow allow the --style flag to bypass ColorProfile, so it can render color codes regardless of stdout? A better option would be to introduce a new command line flag (.e.g --mode, --render-mode or --color-profile) to override the detected color profile, so glow --mode <truecolor|ansi|ansi256|ascii> will render the file with the specified profile value regardless of what was detected.

Here is a screenshot using vifm. The same also happens when using ranger:

20240916-001012