Jim Porter writes: > > Ah, in that case, then I think you'd want to change the logic in esh-var.el so > that, when 'comint-pager' is nil, $PAGER returns the real value of PAGER from > the environment. Since this behavior is opt-in, I think it would be enough to > just make this fix (and ignore the visual command stuff), though special > handling for visual commands would still be nice to have. > I decided to work on this instead of sleeping so I apologize if these patches are of poor quality. I still haven't looked into how everything interacts with the visual commands but it took some real effort (maybe because I'm tired :P) to get what I got so far and I think it's good enough. My main pain point was trying to figure out how to maintain the ability to set/unset the PAGER variable. These current patches allow you to set/unset the PAGER variable iff you don't set comint-pager. It even allows you to do stuff like 'PAGER=cat git log' (see eshell-handle-local-variables) without modifying buffer state (as it should). Maintaining those capabilities when comint-pager is set seems very difficult so I gave up. Trying to setq-local comint-pager in the set function might honestly be a better user experience for those that set comint-pager but then doing 'PAGER=cat git log' would cause a permanent buffer local change. So currently everything works 100% great and as expected if comint-pager is nil. If comint-pager is not-nil then you cannot set PAGER in a way that will take any affect.