(Originally mis-sent with the wrong email address.) Attached is a patch with tests to fix this. Note that I reset `eshell-in-pipeline-p' in two places: 1. `eshell-subcommand-bindings': This handles any case where a subcommand is invoked. This can happen with the following syntaxes: {CMD}, ${CMD}, and $. 2. `eshell-command-to-value': This handles cases where a command is run synchronously. This can happen with some of the syntaxes mentioned above: {CMD} and ${CMD}. However, it can also happen for Lisp forms like (LISP) and $(LISP). (Most Lisp forms aren't likely to consult `eshell-in-pipeline-p', but if you were calling an Eshell built-in command using Lisp syntax, you might run into this issue.)