From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#54486: 29.0.50; Eshell `escaped' string property can "leak" into output Date: Sun, 20 Mar 2022 20:52:43 -0700 Message-ID: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10446"; mail-complaints-to="usenet@ciao.gmane.io" To: 54486@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 21 04:53:11 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 1nW96V-0002aF-C2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 04:53:11 +0100 Original-Received: from localhost ([::1]:58174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nW96T-00015z-VH for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 23:53:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nW96N-000157-9M for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 23:53:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nW96N-0003ZZ-0U for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 23:53:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nW96M-0000Ow-NF for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 23:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2022 03:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54486 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.16478347711518 (code B ref -1); Mon, 21 Mar 2022 03:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Mar 2022 03:52:51 +0000 Original-Received: from localhost ([127.0.0.1]:35525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW96B-0000OO-5q for submit@debbugs.gnu.org; Sun, 20 Mar 2022 23:52:51 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:35624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW96A-0000OH-9c for submit@debbugs.gnu.org; Sun, 20 Mar 2022 23:52:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nW968-0000zy-1T for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 23:52:48 -0400 Original-Received: from [2607:f8b0:4864:20::102e] (port=43819 helo=mail-pj1-x102e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nW966-0003VG-4I for bug-gnu-emacs@gnu.org; Sun, 20 Mar 2022 23:52:47 -0400 Original-Received: by mail-pj1-x102e.google.com with SMTP id n7-20020a17090aab8700b001c6aa871860so7215590pjq.2 for ; Sun, 20 Mar 2022 20:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:subject:to:message-id:date:mime-version:content-language :content-transfer-encoding; bh=QQiefOb+/1lAIquHXDo4UlfdblpZgzRivnkDVh63W1s=; b=HXcw0VmQ6OGn3ay1XU7TmI/D6EEobtmm8CT3XYY7KcVkqJQTZLfaornjrkWBYQuwXG bySVGafj+c/VKpy1wUg8csmZnhAu4/eYoDtkSmaSzOwJPAFgKubD+mVfZaU8iAYSOQrk kkMhCfF5+QClw0y+AKNhzfpOMGlSvXf6h5huc294CJ9lDKvnhj7r7QgY4cZKueNvuTmK Ncuv8QjkQ9wXtAtoy/8g7yLAUSWo0M8Hyz+ftmIeVWwnq3wo0I50rLVNO9HxH1hfpN4l 9xlx9POOQ9D9zmaE9KjJJEK09UB9/RFRYU/Pkkjj7+1gBAeDHPdUbG7Og3zKbbSc+b8k L4og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:mime-version :content-language:content-transfer-encoding; bh=QQiefOb+/1lAIquHXDo4UlfdblpZgzRivnkDVh63W1s=; b=FGTCVmXQEDh6tAb+SXFo2JQuIfMx3a3g62sO8g/k+JtqDNfouho/v63S0WlwixWE40 eGJOpOsf4umhcRdjjWiyrxfPyKNZ8sajefPbovS8CCHV+Yrixs1UCKbv3ZYtqoZzv46P VfCEHCILcHfrfCVv1MEc3X96EgXxiFhnNrG/ANItoh9bAnR9gyFTy2mSpcpFpkufEYLM tVzq/fsNungZEcGu2qjoVFcxwnpF7fKXZgYJvxveTpetzUS2Y7zFGpBwHHj94KezVEa3 ctPFRyD6ZL9DpcAR+XtMi6RqzxyEEYtXR9w4iz/XmvS304ddeMHQZ2vy0MVSQahAHKwh 1StA== X-Gm-Message-State: AOAM530uVMFD7QEKOG5JZlxvXOeLOw3a91eHSigH7RTe2QfrJHuZaJPY aUtGRnncbCVYZT7kKr3/rKn0JE5Stj4= X-Google-Smtp-Source: ABdhPJxcPzNtny4+85L/ce1mesBexrKC9RumILcA93fU3Gq6sj+hRHyfPeAqfVF3fgqOYlV2ZB/5Bg== X-Received: by 2002:a17:90b:4a47:b0:1c6:42c6:fef2 with SMTP id lb7-20020a17090b4a4700b001c642c6fef2mr23716481pjb.147.1647834764522; Sun, 20 Mar 2022 20:52:44 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id q3-20020a63ae03000000b003820cc3a451sm9519448pgf.45.2022.03.20.20.52.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Mar 2022 20:52:44 -0700 (PDT) X-Mozilla-News-Host: news://news.gmane.org:119 Content-Language: en-US X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Xref: news.gmane.io gmane.emacs.bugs:228644 Archived-At: When using Eshell, it's possible to inadvertently add an `escaped' string property to strings, resulting in some pretty surprising behavior. Starting from "emacs -Q --eval '(eshell)'": ~ $ setq var (list "foo" "bar") ("foo" "bar") ~ $ echo $var ("foo" "bar") ~ $ echo $var[0] foo ~ $ echo $var (#("foo" 0 3 (escaped t)) "bar") This happens because when the `$var[0]' argument is parsed in the third command, the function `eshell-interpolate-variable' wraps the code-to-be-called with `eshell-escape-arg'. That function adds an `escaped' property to any string passed into it. The `escaped' property is used to indicate that the string should be treated literally (i.e. any special characters like "$" will no longer have any special meaning in Eshell). That's the right *behavior*, but ideally, there'd be a way to do so that doesn't involve manipulating the string like this. Eshell can't know the lifetime of the string, and it seems like a bad idea in general to go around messing with string properties just because you referenced that string somehow in Eshell. I can't think of an obvious fix for this though. Any ideas?