From unknown Thu Jun 19 14:03:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#69937 <69937@debbugs.gnu.org> To: bug#69937 <69937@debbugs.gnu.org> Subject: Status: 29.1; Eshell ${} expansion includes stderr Reply-To: bug#69937 <69937@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:03:55 +0000 retitle 69937 29.1; Eshell ${} expansion includes stderr reassign 69937 emacs submitter 69937 Richard Sent severity 69937 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 22 00:26:22 2024 Received: (at submit) by debbugs.gnu.org; 22 Mar 2024 04:26:22 +0000 Received: from localhost ([127.0.0.1]:40595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnWU1-00035R-81 for submit@debbugs.gnu.org; Fri, 22 Mar 2024 00:26:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:35968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnWTy-00035A-9s for submit@debbugs.gnu.org; Fri, 22 Mar 2024 00:26:19 -0400 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 1rnWTJ-00072b-6h for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2024 00:25:37 -0400 Received: from mail-108-mta209.mxroute.com ([136.175.108.209]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnWTG-0007nV-8e for bug-gnu-emacs@gnu.org; Fri, 22 Mar 2024 00:25:36 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta209.mxroute.com (ZoneMTA) with ESMTPSA id 18e646371790003bea.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 22 Mar 2024 04:20:22 +0000 X-Zone-Loop: 319f5640652ff36e721ab308d35683f063d269e666e8 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rD7TA8zPYKZrz+RvA+iwjc4GeJzsdgskz7Gom5hJdhI=; b=H2Kfc9l1qPYi+XU40OZ5rNJQP3 kEaq7CR7FNzMt/NcKFk98qS2bn5mJBExI7yS1hGNqCLCHxNl9FKS7Z2lYrOeQgVAVCUz4RQe/ulsw i5ZIyjFsyH3ldTxsjdi5DU80bNhb2YO9AL07nPJRQQJL5wp+80MA5T/3WEDb6mWtojMzpYSO/Q5CO +XnN9NKJT9bV+GmeBsGFV7KeqT83QbdghvdkP5O0H2HtlOYFYrIOkRCQqu4Oc9YG2bCsZH+oCx3rp wEm9zJNqqyombuYQRTo/M28b4D96RKJIFS1VpiWKqNy1P2QqGjVLCP6ot/26BOKwKRqjoKetHEaip eVxdYAjw==; From: Richard Sent To: bug-gnu-emacs@gnu.org Subject: 29.1; Eshell ${} expansion includes stderr Date: Fri, 22 Mar 2024 00:20:14 -0400 Message-ID: <87v85ej3sx.fsf@freakingpenguin.com> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.209; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta209.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi, When performing expansion with ${} in Eshell, the expansion will include both stdin and stderr. --8<---------------cut here---------------start------------->8--- ~ $ echo ${ruby -e 'puts 0' -e 'STDERR.puts "1"' -e 'puts 2'} (0 1 2) --8<---------------cut here---------------end--------------->8--- This behavior is undocumented, different from normal shells and can introduce surprising behavior where the resulting output list can vary. (Multithreaded programs are less likely to worry about the ordering of stdout and stderr statements, stderr may not be printed every run, different things may be printed to stderr, etc.) If this behavior is desired, it should be explicitly documented in the Eshell manual. Personally I feel ${} expansion should just use stdout, not stderr. A third alternative may be to introduce another $ expansion that only uses stdout. Confirmed with emacs -Q. In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) Windowing system distributor 'The X.Org Foundation', version 11.0.12101011 System Description: Guix System Configured using: 'configure CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash --prefix=/gnu/store/ni49ash6niyqny9h8wmp71z8hmpmx80k-emacs-29.1 --enable-fast-install --with-cairo --with-modules --with-native-compilation=aot --disable-build-details' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $EMACSLOADPATH: /home/richard/.guix-home/profile/share/emacs/site-lisp:/gnu/store/ni49ash6niyqny9h8wmp71z8hmpmx80k-emacs-29.1/share/emacs/29.1/lisp value of $EMACSNATIVELOADPATH: /home/richard/.guix-home/profile/lib/emacs/native-site-lisp value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Message Minor modes in effect: hexl-follow-ascii: t eshell-syntax-highlighting-global-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-track-minor-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-services-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t erc-networks-mode: t beacon-mode: t all-the-icons-completion-mode: t which-key-mode: t display-time-mode: t marginalia-mode: t savehist-mode: t vertico-mode: t global-git-commit-mode: t mml-mode: t magit-auto-revert-mode: t eat-eshell-mode: t shell-dirtrack-mode: t server-mode: t global-auto-revert-mode: t delete-selection-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t column-number-mode: t line-number-mode: t auto-fill-function: message-do-auto-fill transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: /gnu/store/x3hyyjg169fqvy0pw2lcvfiswvi607k2-emacs-transient-0.5.3/share/emacs/site-lisp/transient-0.5.3/transient hides /gnu/store/ni49ash6niyqny9h8wmp71z8hmpmx80k-emacs-29.1/share/emacs/29.1/lisp/transient /gnu/store/6pzp2k94wb6ck9ra4p45v45fx1kbyn1y-emacs-project-0.10.0/share/emacs/site-lisp/project-0.10.0/project hides /gnu/store/ni49ash6niyqny9h8wmp71z8hmpmx80k-emacs-29.1/share/emacs/29.1/lisp/progmodes/project /gnu/store/rqnkbk05rfwsy2h5cd1cif30sdr5bcr8-emacs-xref-1.6.3/share/emacs/site-lisp/xref-1.6.3/xref hides /gnu/store/ni49ash6niyqny9h8wmp71z8hmpmx80k-emacs-29.1/share/emacs/29.1/lisp/progmodes/xref /gnu/store/78zv37kfy77gdj0jswhs81wg9s10s29l-emacs-soap-client-3.2.3/share/emacs/site-lisp/soap-client-3.2.3/soap-client hides /gnu/store/ni49ash6niyqny9h8wmp71z8hmpmx80k-emacs-29.1/share/emacs/29.1/lisp/net/soap-client /gnu/store/78zv37kfy77gdj0jswhs81wg9s10s29l-emacs-soap-client-3.2.3/share/emacs/site-lisp/soap-client-3.2.3/soap-inspect hides /gnu/store/ni49ash6niyqny9h8wmp71z8hmpmx80k-emacs-29.1/share/emacs/29.1/lisp/net/soap-inspect Features: (shadow emacsbug ibuf-ext ibuffer ibuffer-loaddefs debug backtrace shortdoc ruler-mode hexl pcmpl-unix align tramp-cmds tramp cl-print em-rebind em-smart tramp-loaddefs trampver tramp-integration tramp-compat latexenc two-column macrostep-c cmacexp macrostep smartparens-c cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs texinfo texinfo-loaddefs pulse consult-xref grep mm-archive sort smiley gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check qp gnus-async gnus-bcklg gnus-ml nndraft nnmh utf-7 nnfolder nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp gnus-cache goto-addr vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view vc bug-reference make-mode eshell-syntax-highlighting em-unix em-term em-script em-prompt em-ls em-hist em-pred em-glob em-extpipe em-cmpl em-dirs em-basic em-banner em-alias eshell dired-aux sh-script smie treesit executable misearch multi-isearch dabbrev ace-window avy geiser-mode geiser-xref geiser-compile vc-git vc-dispatcher mule-util embark-consult consult magit-bookmark bookmark network-stream epa-file erc-list erc-menu erc-join erc-ring erc-pcomplete erc-track erc-match erc-button erc-fill erc-stamp erc-netsplit erc-services erc-goodies erc erc-backend erc-networks erc-common erc-compat erc-loaddefs embark-org embark ffap diary-lib diary-loaddefs cal-iso oc-basic ol-eww eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range gnus-win ol-docview doc-view jka-compr image-mode exif ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi face-remap org-agenda org-element org-persist xdg org-id avl-tree org-refile smartparens-org ob-plantuml org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs ol org-fold org-fold-core org-compat org-version org-macs smartparens-config smartparens-text smartparens advice rainbow-delimiters hl-line rs-ui beacon all-the-icons-completion all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons which-key diminish doom-dracula-theme doom-themes doom-themes-base moody time rs-tools rs-smtp smtpmail rs-skeleton skeleton rs-project rs-navigation marginalia orderless savehist vertico rs-media rs-magit magit-extras magit-submodule magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit package url-handlers magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff diff-mode git-commit log-edit message sendmail yank-media rfc822 mml mml-sec epa derived mailabbrev gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert magit-margin magit-transient magit-process with-editor magit-mode magit-git magit-base magit-section cursor-sensor crm rs-integrations debbugs soap-client mm-decode mm-bodies mm-encode url-http url-auth mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw nsm puny rng-xsd rng-dt rng-util xsd-regexp rs-ibuffer rs-eshell esh-var esh-mode esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util files-x eat term disp-table ehelp shell pcomplete color rs-erc rs-epg epg rfc6068 epg-config rs-elfeed rs-editing rs-dired ls-lisp dired dired-loaddefs rs-core server autorevert filenotify delsel comp comp-cstr warnings rx exec-path-from-shell rs-auth-source auth-source-pass rs-scheme geiser-guile info-look info transient format-spec geiser geiser-debug geiser-repl geiser-image geiser-capf geiser-doc geiser-menu geiser-autodoc geiser-edit geiser-completion geiser-eval geiser-connection tq geiser-syntax scheme geiser-impl help-fns radix-tree geiser-log geiser-popup view geiser-custom geiser-base rs-rust rs-password-store rs-org plantuml-mode dash edmacro kmacro use-package-bind-key bind-key rs-docker rs-csharp rs-cl slime easy-mmode apropos compile etags fileloop generator xref project arc-mode archive-mode noutline outline icons pp comint ansi-osc ansi-color ring hyperspec thingatpt browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source eieio eieio-core password-cache json map byte-opt url-vars mailcap rs-nnrss rs-gnus gnus nnheader gnus-util text-property-search time-date mail-utils range mm-util mail-prsvr wid-edit cus-load rs-utils rs-constants battery dbus xml subr-x no-littering compat cl-macs gv cl-extra help-mode cl-seq use-package-core cl-loaddefs cl-lib bytecomp byte-compile lorem-ipsum-autoloads geiser-autoloads geiser-guile-autoloads xterm-color-autoloads rust-mode-autoloads xref-autoloads project-autoloads spinner-autoloads hydra-autoloads ht-autoloads lsp-mode-autoloads flycheck-autoloads rustic-autoloads password-store-autoloads pass-autoloads plantuml-mode-autoloads yaml-mode-autoloads docker-compose-mode-autoloads dockerfile-mode-autoloads web-mode-autoloads macrostep-autoloads slime-autoloads which-key-autoloads moody-autoloads doom-themes-autoloads shrink-path-autoloads nerd-icons-autoloads doom-modeline-autoloads dirvish-autoloads diminish-autoloads beacon-autoloads all-the-icons-completion-autoloads memoize-autoloads all-the-icons-autoloads embark-autoloads consult-autoloads marginalia-autoloads orderless-autoloads vertico-autoloads popup-autoloads s-autoloads f-autoloads dumb-jump-autoloads avy-autoloads ace-window-autoloads tablist-autoloads pdf-tools-autoloads async-autoloads with-editor-autoloads transient-autoloads magit-autoloads soap-client-autoloads debbugs-autoloads eshell-syntax-highlighting-autoloads eat-autoloads elfeed-autoloads rainbow-delimiters-autoloads markdown-mode-autoloads dash-autoloads smartparens-autoloads exec-path-from-shell-autoloads compat-autoloads no-littering-autoloads guix-emacs rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-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 lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 3008426 209077) (symbols 48 52597 24) (strings 32 262936 38973) (string-bytes 1 9305503) (vectors 16 149078) (vector-slots 8 3199779 256497) (floats 8 2383 4879) (intervals 56 233797 8887) (buffers 984 124)) -- Take it easy, Richard Sent Making my computer weirder one commit at a time. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 22 01:58:37 2024 Received: (at 69937) by debbugs.gnu.org; 22 Mar 2024 05:58:37 +0000 Received: from localhost ([127.0.0.1]:48597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnXvI-0008Md-QC for submit@debbugs.gnu.org; Fri, 22 Mar 2024 01:58:37 -0400 Received: from mail-pl1-f171.google.com ([209.85.214.171]:43114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnXvG-0008MG-TJ for 69937@debbugs.gnu.org; Fri, 22 Mar 2024 01:58:35 -0400 Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1def89f0cfdso21601435ad.0 for <69937@debbugs.gnu.org>; Thu, 21 Mar 2024 22:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711087009; x=1711691809; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=pxQ+MunqKB7I+/Id/SYRYpxdupQ0YcxPg4DJrZEEoCo=; b=gHecODzB485/LgBSRD3LFOBLEgiyTeXc9XcZQm/hys9zPdkDBbRJIYmPYYQu/XFeyF uEvZaiS+76YDWz+EkG0kOneHpIOVlBRNnKvpgHKirR1/dDUUcIKx8K3D7Caau2PgAMr7 K8jTu/AlRitw+y1z7EuVRp8pF8kcSU8SAqMKr0mq7/KgZhnoyd+xWiITczycNzsSi++I aYJpU8LRW5l2HbKLR1SxI3rEkY1gyfwxR6KYnnjcyNsZipAG/29hNklwkIvFnS0k7AcC fZ5/u+VhRFm/I6VuIphjs6NcvAUo72kBfdOnn4qMijT+ieT2KI9ze3+Jf5hg3iJwejV1 YZUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711087009; x=1711691809; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pxQ+MunqKB7I+/Id/SYRYpxdupQ0YcxPg4DJrZEEoCo=; b=VpZZ64ydsHXIRm+RpvB10LJWI/25+vtT/ALo1Wg1xkMgUsvzWRNI3fiUjLUNJoI0p/ mwafvXoAZgPlmPPa35uLq9a3eYeD0obNKM4IYpNFGcriS7Ysis60cl5F8rD1UI6S3zbh 0BJfWCNnqZfEuHZgVMUQliqDCFV9SonaavbKuN4dbbYtyKIq6nKZGTYqxkr6IqUWocKu rONjIbDeO7XSmEXYbTC1CuIC3mvDhRPMucC9HoyHzevqpu52b3f62gm/0cdwmAezpTk4 XtjVitKsByrSgX6OdIPzR9DfOQaAWIu7IawQvnCUuRjo7uCxTe8szdEE5iq1JEdqVJOc zVEQ== X-Forwarded-Encrypted: i=1; AJvYcCUMRq5SIyvVSDK4yAb+Oqjh8L9e9cVEy7M4QwcmzQbxFAElV32Xs1URQLPInYkivdbFlVeZbZUc/V7aep9UfX5Lu3atdmE= X-Gm-Message-State: AOJu0YzALrbYfuilOn0bgv5c8PbGwDD5blhYqjG3dyFt2S3+Zv0aIdjS l+td6rtjDCAvcHwHSmaeA6E+5m1etaBab5ACriMwjXtCM60EwsUb X-Google-Smtp-Source: AGHT+IF4pEgweY2gjnt/gUb3DzGCGyTE/+kZQ6hQB24GFNZ3t30YZKZ4QmrjgtMjWInqoLqdLohKWA== X-Received: by 2002:a17:902:ce86:b0:1dd:8ed0:59d0 with SMTP id f6-20020a170902ce8600b001dd8ed059d0mr1728485plg.17.1711087008557; Thu, 21 Mar 2024 22:56:48 -0700 (PDT) Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id l13-20020a170903244d00b001dcc160a4ddsm943253pls.169.2024.03.21.22.56.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Mar 2024 22:56:48 -0700 (PDT) Message-ID: Date: Thu, 21 Mar 2024 22:56:48 -0700 MIME-Version: 1.0 Subject: Re: bug#69937: 29.1; Eshell ${} expansion includes stderr Content-Language: en-US To: Richard Sent , 69937@debbugs.gnu.org References: <87v85ej3sx.fsf@freakingpenguin.com> From: Jim Porter In-Reply-To: <87v85ej3sx.fsf@freakingpenguin.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69937 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 3/21/2024 9:20 PM, Richard Sent wrote: > When performing expansion with ${} in Eshell, the expansion will include > both stdin and stderr. > > --8<---------------cut here---------------start------------->8--- > ~ $ echo ${ruby -e 'puts 0' -e 'STDERR.puts "1"' -e 'puts 2'} > (0 1 2) > --8<---------------cut here---------------end--------------->8--- Thanks for noticing this. I think this is simply a bug (although it may originally have been intentional due to Eshell's more-limited redirection operators in Emacs 28 and earlier). It would probably be good to follow other shells here, and people who *want* to capture both stdout and stderr can use 2>&1 as usual. I'll try and put together a patch for this over the weekend. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 23 15:39:32 2024 Received: (at 69937) by debbugs.gnu.org; 23 Mar 2024 19:39:32 +0000 Received: from localhost ([127.0.0.1]:49648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ro7DI-0000DP-BE for submit@debbugs.gnu.org; Sat, 23 Mar 2024 15:39:32 -0400 Received: from mail-oi1-f173.google.com ([209.85.167.173]:57526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ro7DF-0000D7-OL for 69937@debbugs.gnu.org; Sat, 23 Mar 2024 15:39:30 -0400 Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3c39177fea4so2153807b6e.2 for <69937@debbugs.gnu.org>; Sat, 23 Mar 2024 12:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711222662; x=1711827462; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=5gOroAj+I5+CR89Q42xxyPoijeeBb0ZDZJJ9hltf+Tw=; b=Z81JQq+hxqggE+BWHGJF42OEJOI+XNI9hd8JQmLP4B5lD1XFTtfkLx62IC/8KvAXEw UvYZcLEAKCHfmevUC6cuseMSbd6nKLGIZf6fIfRS0VhSYq28hEXUX0gCWllkOpvwAcox d3H+7UbCZeA1kO703gGzbkqcFO4oyVWMi1R5wGpZ+71w2Dc7EK67jm5KUvM3RU5CwdVv XMY6Uw3tLQPtekD3MWZtAcV+EhKgd5xZuLSze/22AdONiofFl7lOfpkmCLRX1xn2s2hM B4ZjTT8RNtXEdsc1m/mHtqtPHGhzcgVGRRhGHESFOK04aul2M6bc3gA13FdOlTNeET06 lDoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711222662; x=1711827462; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5gOroAj+I5+CR89Q42xxyPoijeeBb0ZDZJJ9hltf+Tw=; b=dG14T81LtLCEyZsfXvvZ1844crl+BVyHkUWoZubPjRZ94s17iBmB3mwVRSyreqdfPc P1UxU3BVDbrmIqDQRVe3yAwpk71/xxUIY/mdRO8jKUPyiA8cVPwkqV1jIA3l97Yyl5Jr Qd+kx/1LtwhmZTAK5PdckGrsaV/vzP0NKVL+wfZMfa3cBTMcMQlg1o77ZXSrXTkt0h22 2gflVHfylw7PK2BmNsFrtHgIAd6bceXg4RbdNgXoIPf+TEX6MmCAe02UW3j92IACUUoT 2edCI7Sh9ygcSlcoLVe9EJH9DuFp1wNjT3oii0LHPHhK6CAsUWH25VnK8GkfFCYmKfjL aqsg== X-Forwarded-Encrypted: i=1; AJvYcCUtv6jC9CAAFimvE0702wWo7dRCQrKko+1i1Q2fr4GwTEntbwN1quOyRe+4M7qmvH9sJazrvq8orYBs+too8BcLHsB7PgI= X-Gm-Message-State: AOJu0Yytw0HpCu09Wp0m0CnG8VlYwTYzgIoDYE/ikNe/pkVAmo1P1ANH VnXvK8hgzGumOTNz9k6HGiK1Edlr1CDyBmBS8xmDX+FV0CoFu+7/m6LUx7Kj X-Google-Smtp-Source: AGHT+IE5snHpwb2rTeZXFoXhFV22JB8q5SuoUJw8Ea7PAmUKAJWOqlF4LnuVjWsacxC9+Q6/o+XyYw== X-Received: by 2002:a17:903:40c3:b0:1e0:a326:e89e with SMTP id t3-20020a17090340c300b001e0a326e89emr2834685pld.37.1711222298562; Sat, 23 Mar 2024 12:31:38 -0700 (PDT) Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id l15-20020a170903244f00b001e014627baasm1898490pls.79.2024.03.23.12.31.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Mar 2024 12:31:38 -0700 (PDT) Message-ID: <0a81134a-8abe-3f20-47cb-e57fe8524a84@gmail.com> Date: Sat, 23 Mar 2024 12:31:37 -0700 MIME-Version: 1.0 Subject: Re: bug#69937: 29.1; Eshell ${} expansion includes stderr Content-Language: en-US From: Jim Porter To: Richard Sent , 69937@debbugs.gnu.org References: <87v85ej3sx.fsf@freakingpenguin.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69937 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 3/21/2024 10:56 PM, Jim Porter wrote: > I'll try and put together a patch for this over the weekend. I looked into this some more and found that it's not quite so easy to do this in a way that preserves functionality. Normally, you should be able to use the "2>&1" syntax to redirect (and thus capture) *all* the output. However, that fails for the $ form, since it will mis-parse this: $&1> Escaping the inner ">" won't work, since the parser doesn't unescape that character. Unescaping that would be tricky to get anyway, so I'm not sure it's the best route. Another hypothetical syntax would be (whitespace just for readability): $< { command 2>&1 } > That *also* doesn't work today, but reworking 'eshell-find-delimiter' should make that possible, and likely fix some other surprising cases in the Eshell syntax. I have some ideas for how to do this, but it's a pretty invasive change, so it'll take quite a bit of thought. I don't have time to do this right now, but I'll take a look in the coming month or so. Thankfully, aside from this wrinkle, all the *other* parts to fix this bug are pretty straightforward, and in fact I already have a WIP patch for them.