@@ -98,10 +98,20 @@ pub(crate) fn get_pager(config_pager: Option<&str>) -> Result<Option<Pager>, Par
9898 Some((bin, args)) => {
9999 let kind = PagerKind::from_bin(bin);
100100
101− // 'more' and 'most' do not supports colors; automatically use 'less' instead
102− // if the problematic pager came from the generic PAGER env var
103− let no_color_support = kind == PagerKind::More || kind == PagerKind::Most;
104− let use_less_instead = no_color_support && source == PagerSource::EnvVarPager;
101+ let use_less_instead = match source {
102+ PagerSource::EnvVarPager => {
103+ // 'more' and 'most' do not supports colors; automatically use 'less' instead
104+ // if the problematic pager came from the generic PAGER env var
105+ let no_color_support = kind == PagerKind::More || kind == PagerKind::Most;
106+
107+ // If PAGER=bat, silently use 'less' instead to prevent recursion ...
108+ let is_self = kind == PagerKind::Bat;
109+
110+ no_color_support || is_self
111+ },
112+ // Never silently replace with less if bat-specific means to set a pager is used
113+ _ => false
114+ } ;
105115
106116 Ok(Some(if use_less_instead {
107117 let no_args = vec![];