On 3/3/2022 11:50 AM, Eli Zaretskii wrote: > Thanks, this now LGTM. Thanks. I found one more issue with the code though: the subscript operator doesn't work on subcommands. For example, from "emacs -Q --eval '(eshell)'": ~ $ echo ${*echo -e "hi\nbye"}[0] ("hi" "bye") Since `${COMMAND}' forms split the output line-by-line, you'd expect this to say "hi", but the subscript operator is a no-op in this case. This was previously documented to work in the docstring for `eshell-apply-indices': For example, to retrieve the second element of a user's record in '/etc/passwd', the variable reference would look like: ${grep johnw /etc/passwd}[: 2] I also updated the manual to indicate that this is possible (though I didn't provide any direct examples), since I thought this already worked based on that docstring. Attached is a patch with some tests for this. Just a note: using subscript on `$' forms is probably not super-useful (at least not currently), though I added support for it anyway for consistency and future improvement. Since the result of that form is the name of a temp file, there's not much reason to do something like `$[0]'. However in the future, if the subscript operator were more advanced, you could do something like `$[/ *]' to split the file name by directory separators. (The "*" is a suggested feature in the "Bugs and ideas" section to return the whole list.)