dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
21.82k stars 364 forks source link

Fix issue where pager would be set to `more` or `most` #1494

Closed ippsav closed 1 year ago

ippsav commented 1 year ago

Bug

Colors wouldn't render properly in case the $PAGER is set to more or most.(fix for #1490 ) 20230729_23h00m14s_grim

Solution

Handle the case where $PAGER is set to more or most by using bat::config::get_pager_executable which sets the pager to less if that's the case.

Unit tests:

env.rs:

  • test_env_parsing_with_pager_set_to_bat
  • test_env_parsing_with_pager_set_to_more
  • test_env_parsing_with_pager_set_to_most
ippsav commented 1 year ago

@dandavison all fixed ! that's true now that i reread the source code of bat, no need for handling BAT_PAGER, thanks !

dandavison commented 1 year ago

Perfect, thanks for doing this!

ippsav commented 1 year ago

You're welcome ! it was a fun thing to do ! and thanks for making such a useful app !