When I typed git diff in eshell, it has weird attribute such like print : in every single line, cannot scroll back, and so on.

I think this is because the default eshell env PAGER is set as less, and I checked with typing echo $PAGER which returns a result, less.

So, as I wrote (setenv "VISUAL" "emacsclient") in my init.el, I added (setenv "PAGER" "emacsclient") line. However, it failed and I found that emacsclient doesn't support pipe, which means echo aaaa | emacsclient ended with an error. and I heard about magit, but I don't think it is a general solution.

Is there any solution to set $PAGER to work properly with eshell?

or How can I make emacsclient to support pipe in eshell?

1 Answer 1


One option would be to disable the PAGER entirely:

(setenv "PAGER" "")

This dumps all output directly to the eshell buffer, so you can use normal Emacs navigation commands to navigate the output.

You can even disable it for an individual command by running the command as:

PAGER="" <command>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.