From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Milan Zimmermann Newsgroups: gmane.emacs.bugs Subject: bug#59545: 29.0.50; Eshell fails to redirect output of sourced eshell file Date: Thu, 24 Nov 2022 10:49:04 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000611e0e05ee395a76" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16424"; mail-complaints-to="usenet@ciao.gmane.io" To: 59545@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 24 16:50:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyEUb-000452-DU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Nov 2022 16:50:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyEUH-00025A-2J; Thu, 24 Nov 2022 10:50:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyEUF-00024i-DE for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2022 10:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyEUF-0000JI-3O for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2022 10:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oyEUE-0000gC-6N for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2022 10:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Milan Zimmermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Nov 2022 15:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59545 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16693049912589 (code B ref -1); Thu, 24 Nov 2022 15:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Nov 2022 15:49:51 +0000 Original-Received: from localhost ([127.0.0.1]:59855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyEU2-0000fg-RZ for submit@debbugs.gnu.org; Thu, 24 Nov 2022 10:49:51 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:59372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyEU0-0000fY-Oq for submit@debbugs.gnu.org; Thu, 24 Nov 2022 10:49:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyETz-00023F-SE for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2022 10:49:48 -0500 Original-Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyETu-0008BR-AH for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2022 10:49:47 -0500 Original-Received: by mail-vs1-xe36.google.com with SMTP id c184so1882205vsc.3 for ; Thu, 24 Nov 2022 07:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ImaTkQdSC5xEj/RP6oAGcgUwSwI9MdVHRI8uF9UfyWI=; b=D/zDKM3aknv24q55I4oKoVhLJE/0ePkwf3wzZ81knwYl+h1Cwr+N4E+SvPxHqzZEZX YBtfalw+6xoo6MDARGKTqjUIG7GC7eA6UkZ1JNAVCxXmFJleBMd5UjdlW9EuKGC2HQgk bq7HZitzBG7k+uZ2q+8WPfmHAJ2s+zKdXKoiAZssCkyp6UstZ+VadzpM8rlwlLQ1JBhy DVKjI7raj43JZPCvnrkNnQZi6bfb7ep1eW9KkGbRYuIVtL/d7MEOxg2HhUXxgxhw3IyY xsRdMQOw3kKcf65f48bR7n482P2c8eCK2hB27RDG37LT3K7E3bt9gJzlq7fEuIuydNCC aUtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ImaTkQdSC5xEj/RP6oAGcgUwSwI9MdVHRI8uF9UfyWI=; b=cCxQRbP7lsmTFwQuKpCyG88ne71qNYIf2+qdr6ksqeHdGjV1yeABhQCbDcTrPiekwp X/MmKipFVtiGcFO/7iX1mRtvVoJsrglf8/S2dAy42dQZ8XrKjXJaE5KnGK51gsiMcskA qPiWETOEHMDN5wNtzk7MoCxtwDiRfKhWtFkhGJnM3hozMc1rvJbr/KRc1cSy/Wd/0/rO 4t41im5MtkhTs3CWxMx1IMQG41PrIMgbYLyHvN5xfJTYqgfR+CXGDlsii///86x1AoLq LYSdLcGa+3TCUNC7sKrLAF2ycOMfzKexy8E5mjJV8WF+ZhkAeRhjW5nWk6r1sdc4mO4o 3+JQ== X-Gm-Message-State: ANoB5pmUIqK0x3naA/eePxm4yDguiEMIROdnt7UsRWfwmT6BM7OraRtP 7SlrluvhHtgvBqN/qgQlORNxWot2QCeScoOegwZvei50KsE= X-Google-Smtp-Source: AA0mqf4CVT8Y3/r3WcUgIWFSdUibwcBP+adjoU9jwNk9SeGHTA3OcNZiZ1ZqMQ/3HTrXL/WHu9kGjZykOOMOBxV8IkY= X-Received: by 2002:a05:6102:49a:b0:3af:600e:84ec with SMTP id n26-20020a056102049a00b003af600e84ecmr10853617vsa.31.1669304980412; Thu, 24 Nov 2022 07:49:40 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::e36; envelope-from=milan.zimmermann@gmail.com; helo=mail-vs1-xe36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248880 Archived-At: --000000000000611e0e05ee395a76 Content-Type: text/plain; charset="UTF-8" Emacs 29 Eshell Bug: Sourcing 'redirect-echo.esh' and redirecting output to a file, results in the first echo string ('hello') showing in eshell, only the second ('there')(presumably because it is last) showing in the output file. To reproduce: Create a eshell script named 'redirect-echo.esh' with two echo commands then source the script, redirecting the stdout to another file or buffer, Actual result: tmp $ cat redirect-echo.esh echo hello echo there tmp $ source redirect-echo.esh > redirect-echo.out hello tmp $ cat redirect-echo.out theretmp $ Expected result: tmp $ cat redirect-echo.esh echo hello echo there tmp $ source redirect-echo.esh > redirect-echo.out tmp $ cat redirect-echo.out hello there tmp $ As a note, the same behavior if elisp "print" is used instead of echo. Also the same behavior if I redirect output to an Emacs buffer instead of the file. In GNU Emacs 29.0.50 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) System Description: openSUSE Tumbleweed Configured using: 'configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-build-details --without-pop --with-mailutils --without-hesiod --with-gameuser=:games --with-kerberos --with-kerberos5 --with-file-notification=inotify --with-modules --enable-autodepend --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --localstatedir=/var --sharedstatedir=/var/lib --libexecdir=/usr/libexec --with-file-notification=yes --enable-locallisppath=/usr/share/emacs/29.0.50/site-lisp:/usr/share/emacs/site-lisp --without-x --with-json --without-xim --with-sound --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-dbus --without-xft --without-gpm --with-pgtk --without-native-compilation --with-toolkit-scroll-bars --with-libotf --with-m17n-flt --with-cairo --without-xwidgets --with-dumping=pdumper 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -D_GNU_SOURCE -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS' LDFLAGS=-flto=auto' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XIM GTK3 ZLIB Important settings: value of $LANG: en_CA.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Eshell Minor modes in effect: shell-dirtrack-mode: t eshell-prompt-mode: t eshell-hist-mode: t eshell-pred-mode: t eshell-cmpl-mode: t eshell-proc-mode: t eshell-arg-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils pcmpl-unix em-unix em-term term disp-table shell subr-x ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-extpipe em-cmpl em-dirs esh-var pcomplete comint ansi-osc ansi-color ring em-basic em-banner em-alias esh-mode eshell esh-cmd generator esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util cus-edit pp cus-start cus-load icons wid-edit cl-loaddefs cl-lib files-x rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 77374 9505) (symbols 48 8750 0) (strings 32 24407 2625) (string-bytes 1 719677) (vectors 16 15061) (vector-slots 8 203823 6855) (floats 8 34 37) (intervals 56 583 0) (buffers 984 12)) --000000000000611e0e05ee395a76 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Emacs 29 Eshell Bug: Sourcin= g 'redirect-echo.esh' and redirecting output
to a file, results = in the first echo string ('hello') showing in eshell,
only the s= econd ('there')(presumably because it is last) showing in the
ou= tput file.

To reproduce: Create a eshell script named 'redirect-= echo.esh' with two
echo commands then source the script, redirecting= the stdout to another
file or buffer,

Actual result:

tmp= $ cat redirect-echo.esh
echo hello
echo there
tmp $ source redire= ct-echo.esh > redirect-echo.out
hello
tmp $ cat redirect-echo.out<= br>theretmp $

Expected result:

tmp $ cat redirect-echo.eshecho hello
echo there
tmp $ source redirect-echo.esh > redirect-e= cho.out
tmp $ cat redirect-echo.out
hello
there
tmp $

As a note, the same behavior if elisp "print" is used instead o= f
echo. Also the same behavior if I redirect output to an Emacs bufferinstead of the file.




In GNU Emacs 29.0.50 (build 1, x8= 6_64-suse-linux-gnu, GTK+ Version
3.24.34, cairo version 1.17.6)
Syst= em Description: openSUSE Tumbleweed

Configured using:
=C2=A0'= configure --host=3Dx86_64-suse-linux-gnu --build=3Dx86_64-suse-linux-gnu=C2=A0--program-prefix=3D --disable-dependency-tracking --prefix=3D/usr=C2=A0--exec-prefix=3D/usr --bindir=3D/usr/bin --sbindir=3D/usr/sbin
= =C2=A0--sysconfdir=3D/etc --datadir=3D/usr/share --includedir=3D/usr/includ= e
=C2=A0--libdir=3D/usr/lib64 --libexecdir=3D/usr/libexec --localstatedi= r=3D/var
=C2=A0--sharedstatedir=3D/var/lib --mandir=3D/usr/share/man
= =C2=A0--infodir=3D/usr/share/info --disable-build-details --without-pop
= =C2=A0--with-mailutils --without-hesiod --with-gameuser=3D:games
=C2=A0-= -with-kerberos --with-kerberos5 --with-file-notification=3Dinotify
=C2= =A0--with-modules --enable-autodepend --prefix=3D/usr
=C2=A0--mandir=3D/= usr/share/man --infodir=3D/usr/share/info --datadir=3D/usr/share
=C2=A0-= -localstatedir=3D/var --sharedstatedir=3D/var/lib
=C2=A0--libexecdir=3D/= usr/libexec --with-file-notification=3Dyes
=C2=A0--enable-locallisppath= =3D/usr/share/emacs/29.0.50/site-lisp:/usr/share/emacs/site-lisp
=C2=A0-= -without-x --with-json --without-xim --with-sound --with-xpm
=C2=A0--wit= h-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-dbus
=C2=A0-= -without-xft --without-gpm --with-pgtk --without-native-compilation
=C2= =A0--with-toolkit-scroll-bars --with-libotf --with-m17n-flt --with-cairo=C2=A0--without-xwidgets --with-dumping=3Dpdumper 'CFLAGS=3D-O2 -Wall<= br>=C2=A0-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3D3 -fstack-protector-strong=C2=A0-funwind-tables -fasynchronous-unwind-tables -fstack-clash-protecti= on
=C2=A0-Werror=3Dreturn-type -flto=3Dauto -D_GNU_SOURCE
=C2=A0-DGDK= _DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS'
= =C2=A0LDFLAGS=3D-flto=3Dauto'

Configured features:
ACL CAIRO = DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIB= OTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY
PDUMPER PGTK PN= G RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP XIM G= TK3 ZLIB

Important settings:
=C2=A0 value of $LANG: en_CA.UTF-8=C2=A0 value of $XMODIFIERS: @im=3Dibus
=C2=A0 locale-coding-system: u= tf-8-unix

Major mode: Eshell

Minor modes in effect:
=C2=A0= shell-dirtrack-mode: t
=C2=A0 eshell-prompt-mode: t
=C2=A0 eshell-hi= st-mode: t
=C2=A0 eshell-pred-mode: t
=C2=A0 eshell-cmpl-mode: t
= =C2=A0 eshell-proc-mode: t
=C2=A0 eshell-arg-mode: t
=C2=A0 tooltip-m= ode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 show-paren-mode: t
=C2= =A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-ba= r-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode: t
= =C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink= -cursor-mode: t
=C2=A0 line-number-mode: t
=C2=A0 indent-tabs-mode: t=
=C2=A0 transient-mark-mode: t
=C2=A0 auto-composition-mode: t
=C2= =A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t

Load-= path shadows:
None found.

Features:
(shadow sort mail-extr ema= csbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mm= l-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-p= roperty-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc223= 1 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm= -util mail-prsvr mail-utils pcmpl-unix
em-unix em-term term disp-table s= hell subr-x ehelp em-script em-prompt
em-ls em-hist em-pred em-glob em-e= xtpipe em-cmpl em-dirs esh-var
pcomplete comint ansi-osc ansi-color ring= em-basic em-banner em-alias
esh-mode eshell esh-cmd generator esh-ext e= sh-opt esh-proc esh-io
esh-arg esh-module esh-groups esh-util cus-edit p= p cus-start cus-load
icons wid-edit cl-loaddefs cl-lib files-x rmc iso-t= ransl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks li= sp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win p= gtk-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list repl= ace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-= bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock<= br>font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq<= br>simple cl-generic indonesian philippine cham georgian utf-8-lang
misc= -lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51= 932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic= chinese composite emoji-zwj charscript charprop case-table
epa-hook jka= -cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs the= me-loaddefs faces cus-face macroexp files window
text-properties overlay= sha1 md5 base64 format env code-pages mule
custom widget keymap hashtab= le-print-readable backquote threads dbusbind
inotify dynamic-setting sys= tem-font-setting font-render-setting cairo
gtk pgtk lcms2 multi-tty make= -network-process emacs)

Memory information:
((conses 16 77374 950= 5)
=C2=A0(symbols 48 8750 0)
=C2=A0(strings 32 24407 2625)
=C2=A0(= string-bytes 1 719677)
=C2=A0(vectors 16 15061)
=C2=A0(vector-slots 8= 203823 6855)
=C2=A0(floats 8 34 37)
=C2=A0(intervals 56 583 0)
= =C2=A0(buffers 984 12))
--000000000000611e0e05ee395a76--