Consider the following shell command: yes | sh -c 'read NAME' Ordinarily, you'd expect that `sh' reads a single "y", exits, and then the next time `yes' tries to write, it finds that the pipe was broken. However, that's not what happens in Eshell. Running the above and then calling `M-x list-processes' will show that `yes' is still running. Attached is a patch (with a test) to fix this by telling Eshell to signal SIGPIPE at the appropriate time. I've also attached a couple small patches to clean up a few tiny issues in Eshell; if it would be better to split those out into a different bug, just let me know. I thought it might be simpler to attach them here rather than one bug for each. (Note: for the test to pass, you might need to remove the .elc files before running the tests. Since the patch updates test/lisp/eshell/eshell-tests-helpers.el and there's not an easy way to force that to recompile before running the actual tests, it can fail in some cases.) As an aside: of course, this is a somewhat contrived example. The real reason I care about this is to support Lisp functions in Eshell pipelines, so that you can run something like `git log | less', where `less' is a Lisp function that opens a View mode buffer. When closing that buffer, it would be nice to kill the `git log' process, since it can go on for quite a while in a big repository. My patch series for that feature is getting pretty unwieldy though (14 patches and counting), so I peeled this off to merge separately.