1

Eshell does not seem to have built-in support for the greater-than symbol. How can I run the command: git diff SHA1234567890 > patch.diff

I could run a separate shell command ...

(start-process "git-diff" nil "/bin/bash" "-c" COMMAND-STRING)`

... but, I'd like to add Eshell support for creating git diff patches.

1 Answer 1

1

Eshell does have support for > redirection, however, it connects process output using standard Emacs functions (start-process, etc). With the default setting of process-connection-type, this means that it uses a pty to communicate with git. git then tries to invoke the pager, which doesn't work so well in the "dumb terminal" that eshell provides. So, possible solutions:

git --no-pager diff SHA1234567890 > patch.diff

(setq process-connection-type nil)
git diff SHA1234567890 > patch.diff

Your Answer

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

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