[For emacs-devel: In gnu.emacs.help there is a discussion about some little eshell, eshell/ls bug. Processes in a pipeline get a TTY for IO (via `start-process'). Quite some programs behave different whether they have a TTY or not. The other thing is that eshell/ls does not output one file per line when in a pipeline (as the usual GNU ls does).] On Wed, 13 Aug 2008 13:21:00 +0200 Thierry Volpiatto wrote: > As Lennart said you call ls with -1 arg or you can always call ls with > this arg setting it like that: > > ,---- > | (setq eshell-ls-initial-args '(-1)) > `---- > > now when you call for example "ls | wc -l" , you will have the > good number of lines. > > It would be cool to have a function to call in some hook to call ls -1 > only if there is a "|" after ls, this function do that but i need a hook > to call it: > > ,---- > | (defun eshell-set-ls () > | (let ((com-line > | (eshell-parse-arguments (re-search-backward "ls") (line-end-position)))) > | (if (equal (nth 1 com-line) '(eshell-operator "|")) > | (setq eshell-ls-initial-args '(-1)) > | (setq eshell-ls-initial-args nil)))) > `---- Try the attached patch. It * Starts subprocesses in a (eshell) pipeline using a pipe and not a TTY (this should also give some performance boost). * Appends "-1" to eshell/ls if ls is called in a pipeline. At the time it's feature freeze for Emacs so it will probably take some time to make it in there. Cc: anyways, maybe some old timer can approve the two lines. David