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

glow stopped displaying colors properly with a pager #35168

Closed
borjator opened this issue Jan 21, 2022 · 2 comments
Closed

glow stopped displaying colors properly with a pager #35168

borjator opened this issue Jan 21, 2022 · 2 comments

Comments

@borjator
Copy link

System

  • xuname:
    Void 5.15.9_1 x86_64 GenuineIntel uptodate rFFFFF
  • package:
    glow-1.4.1_1

Expected behavior

glow -p displays formatted Markdown with colors in my pager (less)

Actual behavior

It shows a lot of color codes without interpreting them:
ESC[38;5;228;48;5;63;1mESC[0mESC[38;5;228;48;5;63;1mESC[0m ESC[38;5;228;48;5;63;1m ESC[0mESC[38;5;228;48;5;63;1mHelloESC[0mESC[38;5;228;48;5;63;1m ESC[0mESC[38;5;252mESC[38;5;252m

Steps to reproduce the behavior

  1. Create a simple Markdown file: echo "# Hello" > hello.md
  2. Display it with glow with a pager: glow -p hello.md

I'm not completely sure if this is a glow bug since I've tried a bunch of different things:

  • The previous version of glow
  • Older versions of less (my favourite pager)
  • I can confirm the same happens with most my second favourite pager
  • I've tried to use a different terminal (xterm instead of xst)
  • I tested using a different TERM environment variable just in case

Anything else I could try?

@demostanis
Copy link

less by default does not interpret escape sequences. Try setting the LESS='-R' environment variable:
LESS='-R' glow -p index.md
It works fine too if you don't pass -p.

@borjator
Copy link
Author

Thank you! That fixed the issue for me.

It's weird because I had an alias for less alias less="less -R" and that was working previously.

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

2 participants