mrusme / reader

reader is for your command line what the “readability” view is for modern browsers: A lightweight tool offering better readability of web pages on the CLI.
https://xn--gckvb8fzb.com/reader-web-page-readability-on-the-cli/
GNU General Public License v3.0
284 stars 11 forks source link

less displays escape character literally #5

Closed themariusus closed 2 years ago

themariusus commented 2 years ago

without less - https://ibb.co/KmKM0X8 - ./reader https://www.iana.org/domains/reserved with less - https://ibb.co/BZ2mrft - ./reader https://www.iana.org/domains/reserved | less v012 amd64 Is there something i'm missing?

mrusme commented 2 years ago

That is odd indeed. I ran reader https://www.iana.org/domains/reserved | less locally and it looked perfectly fine. Could you check what your less command is? My system is using less, not more.

themariusus commented 2 years ago

less 590 (PCRE2 regular expressions) Copyright (C) 1984-2021 Mark Nudelman I also tried more, the same. I'm thinking maybe it's "config" specific to my setup; I'm using Arch linux in the suckless simple terminal (st).

mrusme commented 2 years ago

Maybe give bat a try and see whether that works. It looks like in your setup something is not interpreting the escape characters when output is piped through less. What happens if you > bla the output and then try to less bla or cat bla it?

themariusus commented 2 years ago

bat seems to work. less seems to need some intervention (https://itectec.com/superuser/linux-less-prompts-for-binary-file-display-when-colors-in-output/)

mrusme commented 2 years ago

That's interesting. It seems like oh-my-zsh sets that automagically. I just checked my env and found this:

LESS=-R -M --shift 5

When I empty it I see the same effect that you saw. Will update the documentation about this, thanks!