Subject: bug#15414: 24.3; piping problems in eshell

From: Joseph Mingrone <[email-masked]>
Date: Wed, 18 Sep 2013 22:47:15 -0300

1. emacs -Q
2. M-x eshell
3. cat a_file | wc -l

The output of 3. will be wrong for most files longer than something like
40 lines and it will often give different results each time 3. is run.
No error messages are given.

In GNU Emacs 24.3.1 (i386-portbld-freebsd9.1, X toolkit)
 of 2013-08-08 on gly.ath.cx
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
Configured using:
 `configure '--localstatedir=/var' '--without-rsvg'
 '--with-x-toolkit=athena' '--without-xaw3d'
 '--without-toolkit-scroll-bars' '--without-gif' '--with-xft'
 '--without-m17n-flt' '--with-otf' '--without-imagemagick'
 '--without-gsettings' '--without-gconf' '--with-xim' '--with-sound'
 '--without-dbus' '--with-xml2' '--with-gnutls'
 '--x-libraries=/usr/local/lib' '--x-includes=/usr/local/include'
 '--prefix=/usr/local' '--mandir=/usr/local/man'
 '--infodir=/usr/local/info/' '--build=i386-portbld-freebsd9.1'
 'build_alias=i386-portbld-freebsd9.1' 'CC=cc' 'CFLAGS=-O2 -pipe
 -fno-strict-aliasing' 'LDFLAGS= -L/usr/local/lib
 -Wl,-rpath=/usr/local/lib' 'CPPFLAGS=-I/usr/local/include' 'CPP=cpp''

Important settings:
  value of $LANG: en_CA.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: EShell

Minor modes in effect:
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-spelling-mode: t
  erc-ring-mode: t
  erc-netsplit-mode: t
  erc-menu-mode: t
  erc-match-mode: t
  erc-log-mode: t
  erc-list-mode: t
  erc-pcomplete-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-autojoin-mode: t
  show-paren-mode: t
  global-auto-revert-mode: t
  multi-web-global-mode: t
  shell-dirtrack-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x 
r e p o r t <tab> <return>

Recent messages:
Checking 24 files in /usr/local/share/emacs/24.3/lisp/cedet...
Checking 57 files in /usr/local/share/emacs/24.3/lisp/calendar...
Checking 87 files in /usr/local/share/emacs/24.3/lisp/calc...
Checking 77 files in /usr/local/share/emacs/24.3/lisp/obsolete...
Checking 1 files in /usr/local/share/emacs/24.3/leim...
Checking for load-path shadows...done
Mark set
Wrote /tmp/docview1001/modified-lr-supplementary.pdf
Type C-c C-c to toggle between editing or viewing the document.
Mark all unread articles as read? (y or n)  y

Load-path shadows:
/home/jrm/.emacs.d/elpa/slime-20130626.1151/slime hides /home/jrm/quicklisp/dists/quicklisp/software/slime-20130720-cvs/slime
/home/jrm/.emacs.d/elpa/slime-20130626.1151/hyperspec hides /home/jrm/quicklisp/dists/quicklisp/software/slime-20130720-cvs/hyperspec
/home/jrm/.emacs.d/elpa/slime-20130626.1151/slime-autoloads hides /home/jrm/quicklisp/dists/quicklisp/software/slime-20130720-cvs/slime-autoloads

Features:
(shadow emacsbug apropos tutorial two-column iso-transl goto-addr view
multi-term imenu sgml-mode shr-color color mule-util gnus-dup gnus-fun
doctor ido-gnus cperl-mode nxml-uchnm rng-xsd xsd-regexp rng-cmpct
rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt
rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util
nxml-glyph nxml-enc xmltok tabify man org-table org-wl org-w3m org-vm
org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp
ob-exp org-exp-blocks org-agenda org-info org-gnus org-docview
org-bibtex bibtex org-bbdb org ob-tangle ob-ref ob-lob ob-table
org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp ob org-compat
org-macs ob-eval org-loaddefs find-func cal-menu calendar cal-loaddefs
cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine grep misearch multi-isearch etags mailalias smtpmail sendmail
sh-script smie url-http url-gw url-auth url-queue url-cache url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse url-vars shr qp sort smiley gnus-cite
flow-fill mm-archive gnus-async gnus-bcklg gnus-ml tramp-cache tramp-sh
tramp tramp-compat tramp-loaddefs help-mode pcmpl-unix em-unix em-term
term disp-table ehelp electric em-script em-prompt em-ls em-hist em-pred
em-glob em-dirs em-cmpl em-basic em-banner em-alias esh-var esh-io
esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module
esh-mode esh-util multi-eshell gnus-topic nndraft nnmh gnus-agent
gnus-srvr gnus-score score-mode nnvirtual gnus-msg parse-time netrc
gnus-cache bbdb-gnus gnus-art mm-uu mml2015 mm-view mml-smime smime dig
mailcap gnus-sum bbdb-snarf mail-extr bbdb-com nnml nntp gnus-group
gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int
gnus-range message idna rfc822 mml mml-sec mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils
mailheader gnus-win gnus gnus-ems nnheader mail-utils gnutls
network-stream starttls server auctex-autoloads tex-site
browse-kill-ring-autoloads dired+-autoloads
exec-path-from-shell-autoloads fill-column-indicator-autoloads
google-translate-autoloads ido-gnus-autoloads finder-inf
mode-compile-autoloads multi-eshell-autoloads multi-term-autoloads
rainbow-delimiters-autoloads smart-tab-autoloads w3m-autoloads info
yasnippet-autoloads erc-track erc-spelling flyspell ispell erc-ring
erc-netsplit erc-menu erc-match erc-log erc-pcomplete erc-button
erc-fill erc-stamp wid-edit erc-join paren hl-line autorevert cus-start
cus-load slime-autoloads multi-web-mode bbdb-autoloads uniquify tls
stumpwm-mode package ido ess-toolbar ess-mouse mouseme browse-url
ess-menu ess-swv ess-noweb ess-noweb-font-lock-mode ess-bugs-l essd-els
ess-sas-d ess-sas-l ess-sas-a shell pcomplete ess-arc-d ess-vst-d
ess-xls-d ess-lsp-l ess-sta-d ess-sta-l cc-vars cc-defs make-regexp
ess-sp6-d ess-sp5-d ess-sp3-d ess-julia ess-r-d compile ess-tracebug
warnings ess-roxy advice advice-preload hideshow ess-help ess-developer
ess-r-args eldoc help-fns ess-s-l ess ess-inf comint ansi-color ring
ess-mode ess-noweb-mode ess-utils ess-custom executable ess-compat
ess-site erc-tex easy-mmode edmacro kmacro cl-macs gv cl cl-lib
erc-services erc-networks erc-goodies erc erc-backend erc-compat
format-spec auth-source eieio byte-opt bytecomp byte-compile cconv
gnus-util time-date mm-util mail-prsvr password-cache thingatpt pp
epa-file epa derived epg epg-config doc-view easymenu jka-compr
image-mode dired bbdb timezone tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dynamic-setting font-render-setting x-toolkit x
multi-tty emacs)