From unknown Sun Jun 15 08:44:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54486: 29.0.50; Eshell `escaped' string property can "leak" into output 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-GNU-PR-Keywords: To: 54486@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16478347711518 (code B ref -1); Mon, 21 Mar 2022 03:53:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Mar 2022 03:52:51 +0000 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 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 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 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 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) 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 From: Jim Porter Message-ID: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> Date: Sun, 20 Mar 2022 20:52:43 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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-Spam-Score: -1.3 (-) 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.3 (--) 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? From unknown Sun Jun 15 08:44:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54486: 29.0.50; Eshell `escaped' string property can "leak" into output Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2022 04:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54486 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 54486@debbugs.gnu.org Received: via spool by 54486-submit@debbugs.gnu.org id=B54486.16478354492844 (code B ref 54486); Mon, 21 Mar 2022 04:05:02 +0000 Received: (at 54486) by debbugs.gnu.org; 21 Mar 2022 04:04:09 +0000 Received: from localhost ([127.0.0.1]:35539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW9H6-0000jo-Q6 for submit@debbugs.gnu.org; Mon, 21 Mar 2022 00:04:08 -0400 Received: from mail-pl1-f180.google.com ([209.85.214.180]:45617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nW9H5-0000jN-54 for 54486@debbugs.gnu.org; Mon, 21 Mar 2022 00:04:07 -0400 Received: by mail-pl1-f180.google.com with SMTP id k6so4478357plg.12 for <54486@debbugs.gnu.org>; Sun, 20 Mar 2022 21:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:references:message-id:date:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=w8zNrskR3f+s8oozTeAU8pf0aUFifnNSNojnIl6uQo8=; b=VyyREuJqzoG2WP6B0RLgAJzhSHZjFw3SRu+0/R1z5D0cug0JE9JyMAnAyrpCsd9wMg yOtKRAazU2C/fDrHFmzflSqcsI7JDsr0kcklLMUEwxLL3y6wWiN2A4MdJ0BdcAHu1HEu ffwZZXbj7//HrJMM13aAPVLCH205GrPTYsDdWaC3VLCsZHhfVHJmtkSynvoSPrkkF9Es rMvnuJeFsVarlGzRXdpM2SWtz9H0H+tqiTduMO6IR+xNdAaqDX2PncJ9GoPYn8V9V8mi 53mIFJn8dHsU97/r37DQlc9jvcJ0ONIeibPeTLCaEpy3ju0yZtV6QM2FlU+CR7h5DflR DZhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:references:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=w8zNrskR3f+s8oozTeAU8pf0aUFifnNSNojnIl6uQo8=; b=RcxXB8ydHHpZy3FYtP6hWLLfI0XWfcKqBjlr8OlXhjJP1CxAMOE9gEoECS9eQ9os4S fpaJ7/xakRDhXTQD93Nphm1I3MSldKrHUggKSuHO2vickOIe4PqLHvKBilfMjzvFVn0R L8rM+cwTol7WOYHqgmjX18QIjknO4Q1+9QikgMg6REZHCxkJklKUlN1xMDN7AOxPj8yq ZfNHyo0h83O+BEkMldfutgVXcmwyb40pmtqDqaIhzM/E9KLOXPh5M7VOjV3koYlF3CJE lLyCWrwza886nPlzUZ4e9zhn6FYV69WoywRDWZ+sToT3BZEB5JQPcdBz29vB8zVMm10P snxg== X-Gm-Message-State: AOAM530I2zynHZZDkSWdsf094NrGEeGPIhsiiTLFuuVljocBKZGxffo7 HVheWqqsvZXUs5M5jGznbF9laggfZ/0= X-Google-Smtp-Source: ABdhPJxmE71y9fEQ3HnB+RA8kqGd89zDwTO+gK3Zwp4SQM2IoPcyXZfodDoywGA2Lc52P1v5q7VVcQ== X-Received: by 2002:a17:902:9a02:b0:14f:2d93:92f4 with SMTP id v2-20020a1709029a0200b0014f2d9392f4mr11377029plp.160.1647835441220; Sun, 20 Mar 2022 21:04:01 -0700 (PDT) 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 x15-20020a056a00188f00b004f7675962d5sm19040027pfh.175.2022.03.20.21.04.00 for <54486@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Mar 2022 21:04:00 -0700 (PDT) From: Jim Porter References: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> Message-ID: <63d8e944-9ae1-42bd-85cf-364532e8d4e2@gmail.com> Date: Sun, 20 Mar 2022 21:04:00 -0700 MIME-Version: 1.0 In-Reply-To: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) 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/20/2022 8:52 PM, Jim Porter wrote: > I can't think of an obvious fix for this though. Any ideas? I forgot to add: the obvious solution might be "just copy the string before propertizing it", but the string might be very long (e.g. output from an external command), so I think it's probably best to avoid making more copies than absolutely necessary. From unknown Sun Jun 15 08:44:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54486: 29.0.50; Eshell `escaped' string property can "leak" into output Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2022 12:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54486 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter Cc: 54486@debbugs.gnu.org Received: via spool by 54486-submit@debbugs.gnu.org id=B54486.164786523628591 (code B ref 54486); Mon, 21 Mar 2022 12:21:02 +0000 Received: (at 54486) by debbugs.gnu.org; 21 Mar 2022 12:20:36 +0000 Received: from localhost ([127.0.0.1]:36073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWH1Y-0007R4-1s for submit@debbugs.gnu.org; Mon, 21 Mar 2022 08:20:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWH1W-0007Qr-Ft for 54486@debbugs.gnu.org; Mon, 21 Mar 2022 08:20:34 -0400 Received: from [2001:470:142:3::e] (port=40934 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWH1R-0005Jg-7X; Mon, 21 Mar 2022 08:20:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UhAG17/RBeWXRbBEWHPhahgSRu54PJ5+Tqloll/SwtU=; b=nMpEsXpzy27q dGCl5zfKHZ3dD98RG/vYVC1sjAkFlNh+5U6/VOSEn4s+qdBiyUw6oozKq+mvXf0XWfLVEP/4Fs5qe C5YTZ6z6siAEgYYOKV5td5p1ZwMuGPThfS7/dmToZBBc0+gmfax4I119BpDJ3xNYwwehRlCDgEjEa vU9hegB9VczaFZVDKIKmZxMwYHN5ZhpKrsQ1Fn5FJ2xVqVj/VToFPupmbZLmTzvm0jMY7k1N9whuK RbVppQE+Ty/uUFmH/5S3Fxzf4AJydsKWgUi2grgOS1yHM4JOTjThboe04kOZz3oihwlMsGssPDlZj 7cZ/w9ZoExFYdVHfZCvVNA==; Received: from [87.69.77.57] (port=3330 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWH1I-0005up-Hr; Mon, 21 Mar 2022 08:20:28 -0400 Date: Mon, 21 Mar 2022 14:19:59 +0200 Message-Id: <834k3rfqfk.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> (message from Jim Porter on Sun, 20 Mar 2022 20:52:43 -0700) References: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Jim Porter > Date: Sun, 20 Mar 2022 20:52:43 -0700 > > 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? Why exactly do you think this should be fixed? I don't think I understand that from your description. We have many features that add text properties to strings, so why is this one different? About the only thing I can think of is to add this property to the default value of yank-excluded-properties, but that's all. From unknown Sun Jun 15 08:44:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54486: 29.0.50; Eshell `escaped' string property can "leak" into output Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2022 19:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54486 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 54486@debbugs.gnu.org Received: via spool by 54486-submit@debbugs.gnu.org id=B54486.164789065921323 (code B ref 54486); Mon, 21 Mar 2022 19:25:02 +0000 Received: (at 54486) by debbugs.gnu.org; 21 Mar 2022 19:24:19 +0000 Received: from localhost ([127.0.0.1]:38334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWNda-0005Xr-S3 for submit@debbugs.gnu.org; Mon, 21 Mar 2022 15:24:19 -0400 Received: from mail-pf1-f178.google.com ([209.85.210.178]:35615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWNdY-0005Xf-Ub for 54486@debbugs.gnu.org; Mon, 21 Mar 2022 15:24:17 -0400 Received: by mail-pf1-f178.google.com with SMTP id a5so16388141pfv.2 for <54486@debbugs.gnu.org>; Mon, 21 Mar 2022 12:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=KTGxpTWmFj7yeq0R3qQ7IQJP4jNArnjlQBMU3wfN7Cw=; b=Y1WkOYGEju0mTYtUG/rHH2odf06nPlQO/7WW9MHMlieCeiz6guq7e/tM3ntTuyMeAz DiPcgcJhImge/XOdHitZdLdIuhdZeocq9PYkc0cwePg+Ro1gMmpOGHIlBITL37mqzCML cRMDos7/tEOJgD7dnHJnTQz6jRTzHv4e4v5S5b9BXqwR4IG0gkVN5m9unWYr0phLNEly oqFGP/xXTbPz7rUgwcIuOIDm/dnguyLQLAs7XfcDqYvM3OQxkwGns48fJLH9fgRvp47C W9SJwmnefFyZhaNa6iev3PrXckBn6q8WnnV2vZboSkHPDsux2KApFXFzg758V2/IexzD Bq5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=KTGxpTWmFj7yeq0R3qQ7IQJP4jNArnjlQBMU3wfN7Cw=; b=2vAypq8gqP0jrxuM8i+6sHyYBJhcizRrrMcWl9yWsnMHkJUDr7D0bA1uIPDi6qQ/db YsuP/sZZx36nxf/qV5Tcier4kN7CXUvgAsh22PH9rOkslYgE/HJ51JfEAKfE9hG3reJc wRNBB+pQMkPbjzCI3Io2ICLzq03fcj2ittF+wCr4/n1VUj2iUZ6BR3yNWe0s7tsmiP9W OTrJV6EwAhRYgNpIfFtE9QfVQ8FQpTUMc+s9jWuCU6KGB3Qez8Sko5yU0PbV7V/OG1bO OFMCgjWQfepFkRifPnqLDonTU822ybXiRQ/5ZGcIUHirlQ8BqnI4wcJpxneq3PRrt3Rb q9fw== X-Gm-Message-State: AOAM533lYP9hmnIXWam19qzlWzXp8oFiodANmNm4HdVtDuXYxAlrC1CC XaSV4qrUeWgBm4tzLehhG8z99HkYEC8= X-Google-Smtp-Source: ABdhPJyveZb1IfmOqetMVw9KQEbCdEHje47z76Bs6Z/QH+a6L75+bqUxVZ9xzSvSl9/C5GUFIRPRzA== X-Received: by 2002:a63:d306:0:b0:34e:4330:efea with SMTP id b6-20020a63d306000000b0034e4330efeamr19236667pgg.174.1647890651100; Mon, 21 Mar 2022 12:24:11 -0700 (PDT) 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 c11-20020a056a000acb00b004f35ee129bbsm21864393pfl.140.2022.03.21.12.24.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Mar 2022 12:24:10 -0700 (PDT) References: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> <834k3rfqfk.fsf@gnu.org> From: Jim Porter Message-ID: Date: Mon, 21 Mar 2022 12:24:09 -0700 MIME-Version: 1.0 In-Reply-To: <834k3rfqfk.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) 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/2022 5:19 AM, Eli Zaretskii wrote: > Why exactly do you think this should be fixed? I don't think I > understand that from your description. We have many features that add > text properties to strings, so why is this one different? About the > only thing I can think of is to add this property to the default value > of yank-excluded-properties, but that's all. I didn't know `yank-excluded-properties' existed. I think that would be a good thing to use for this. Besides that, I think it would be best if Eshell didn't show the `escaped' property when printing things under normal circumstances. It's really just for internal bookkeeping in Eshell, so I think users are unlikely to want to see it in most cases. The best way to fix this might be to rethink how Eshell (specifically `eshell-stringify') prints lists by default. This is mentioned in bug#12689 (though that bug additionally describes an unrelated issue with Eshell subcommands that I've since fixed). Finally, maybe it would be good to change the name of the `escaped' property to something like `eshell-escaped'. It took me quite a while to figure out where that property was even coming from when I first noticed it. Technically, that would be an incompatible change, but since this property is for internal bookkeeping in Eshell, I'd be very surprised if anyone else was relying on it. From unknown Sun Jun 15 08:44:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#54486: 29.0.50; Eshell `escaped' string property can "leak" into output Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2022 20:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54486 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter Cc: 54486@debbugs.gnu.org Received: via spool by 54486-submit@debbugs.gnu.org id=B54486.16478928381297 (code B ref 54486); Mon, 21 Mar 2022 20:01:01 +0000 Received: (at 54486) by debbugs.gnu.org; 21 Mar 2022 20:00:38 +0000 Received: from localhost ([127.0.0.1]:38475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWOCj-0000Kr-Jd for submit@debbugs.gnu.org; Mon, 21 Mar 2022 16:00:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWOCh-0000Ke-S5 for 54486@debbugs.gnu.org; Mon, 21 Mar 2022 16:00:36 -0400 Received: from [2001:470:142:3::e] (port=47576 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWOCc-0007LH-GM; Mon, 21 Mar 2022 16:00:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=L7j0uvBY4tWl5ASoQPmm0xzko7Z4zFDzC02usvaGChg=; b=sWXPbQZK2tC7 2renQPUjCxYP58x6uv6sWD4KKrZ7xToBYW4h01mX1CY7X4oyAQeTIAW41Fyx1s443yKRcr240oFpF OyhrUJGwsxeaDNe0k/P0cCSacTF/qed2G7nqarBvJFxs3o0iERJBiNOChuVhd8/KyjIr4cWC2+2Zq VKgkj9Mrt2VWpNjaZJxzr6H33BvA8Co0r3kNibosoGQQNnEbuIBoCagr3mnm5ZkXjScDHwlo47BRB //Btx7C0o5TNQE9s+UxSUDV6d5YiRaTNHCDTApAUqDsixsDIADHlO94fwHCqUFObi8hP+3idlm4xT oGhoQ959jCkvdCjIAYiDGQ==; Received: from [87.69.77.57] (port=2526 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWOCN-0002qj-59; Mon, 21 Mar 2022 16:00:29 -0400 Date: Mon, 21 Mar 2022 22:00:00 +0200 Message-Id: <83cziff54v.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Jim Porter on Mon, 21 Mar 2022 12:24:09 -0700) References: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> <834k3rfqfk.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > Cc: 54486@debbugs.gnu.org > From: Jim Porter > Date: Mon, 21 Mar 2022 12:24:09 -0700 > > I didn't know `yank-excluded-properties' existed. I think that would be > a good thing to use for this. > > Besides that, I think it would be best if Eshell didn't show the > `escaped' property when printing things under normal circumstances. It's > really just for internal bookkeeping in Eshell, so I think users are > unlikely to want to see it in most cases. The best way to fix this might > be to rethink how Eshell (specifically `eshell-stringify') prints lists > by default. This is mentioned in bug#12689 (though that bug additionally > describes an unrelated issue with Eshell subcommands that I've since fixed). Eshell commands that print strings could remove that property. > Finally, maybe it would be good to change the name of the `escaped' > property to something like `eshell-escaped'. Yes, that'd be a good thing. But I'm worried that it could cause failures in existing code, couldn't it? We could do that as an experiment and see if anyone complains. From unknown Sun Jun 15 08:44:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jim Porter Subject: bug#54486: closed (Re: 29.0.50; Eshell `escaped' string property can "leak" into output) Message-ID: References: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> X-Gnu-PR-Message: they-closed 54486 X-Gnu-PR-Package: emacs Reply-To: 54486@debbugs.gnu.org Date: Sun, 24 Nov 2024 06:58:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1732431481-6362-1" This is a multi-part message in MIME format... ------------=_1732431481-6362-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #54486: 29.0.50; Eshell `escaped' string property can "leak" into output which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 54486@debbugs.gnu.org. --=20 54486: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D54486 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1732431481-6362-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 54486-done) by debbugs.gnu.org; 24 Nov 2024 06:57:59 +0000 Received: from localhost ([127.0.0.1]:60486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF6ZC-0001eN-T1 for submit@debbugs.gnu.org; Sun, 24 Nov 2024 01:57:59 -0500 Received: from mail-pf1-f176.google.com ([209.85.210.176]:60648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF6ZA-0001eD-Ub for 54486-done@debbugs.gnu.org; Sun, 24 Nov 2024 01:57:57 -0500 Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-72410cc7be9so3138551b3a.0 for <54486-done@debbugs.gnu.org>; Sat, 23 Nov 2024 22:57:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732431416; x=1733036216; 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=FRupJjo0DP3GapldKbjqB4pmk1SH5EppiZt0CokxurE=; b=KzzhZfZfC+0gQB6Yk55EvvMnWxOdto11NF8rtmWPkoVcID5Ec4OpxPZh1qbjYdEXX+ 6Sovoeh5/W4xSYZXRAO+oa57nSNYEGGcMn7IpGVfp7bhCTKn3Ys1pIOKHoR7OdqW/XnQ UHes4vIeMBiiqZnTVHZkpVvL+qjiT74zOng2EqvP/Fi45Ytt465IwfL/MZMjrQhyTE79 CwmL4SekXILVD1YSBL+rTGNfk7PSRu1Z664yI/SI+Equ4q5ooXch0YgJk5KGCs24+VEb agSdkye+SCSIXiMLdCG0Hmg0GWoi7x24RLLTNO0EXc6uxtMkRCujxq4f4JEdB2lq/tNs ih4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732431416; x=1733036216; 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=FRupJjo0DP3GapldKbjqB4pmk1SH5EppiZt0CokxurE=; b=wkDzk4hHzywIjygOGZc8s3xiwmSmCgTVc6T/ZMoHdxcxn5mWtU0WxN+GLths/sZB+G mn7jSJetVg6iRHR5fHgsAvop4sUb1MrKhuGO/DVABIaWN7L7hEDnnPveWWVKhAYAE8l/ EZCAP+sxJjEPzND+t9b3qjhOZ1aCIRM0pHlsr68BfxyRxA9dvgE+FsZrgVAdwB5T5cCs 4vHDrPcFYdNDSmR22IkxAqLBkafBepispz0NMlo6nVXT88HxqdDy71RUqoDxho9OT5qO sRvlFzazlw32xnWRrpa21/STiJIfqTCV4M863NTEh8spyuzaY3iWR3bGGjWXVTLiJupQ J1mQ== X-Gm-Message-State: AOJu0YwvaeN2q9KEQnsWfdMQCCz8DjfLR2IehjLtsnO1LUeSlnfifOtG 1qvY9sG2UMf0QmyABddu9xAshNfLB4kIhtETKHryP1ZZwpylpm4nDlZL5Q== X-Gm-Gg: ASbGncuEf8p5v360Vvo0cqwP7HvFN6sXfBPYGOYER1ZGiageUxypw7XDNd5ftofdLyQ cLoH5LixH1T0RKu9Om29y/JeA6+KPzBH6iy3NmwYgpT56nBlzP6DZ9l29ls8gmR/fNdTSaETPu/ 5EIirAoUhqZYZI8yotjC9lXK5iiGnfuXYt1cH8JmRyJCJp2Gi3PhDVffjPAjCLm12vzKzbQnFBV DWkTSdAAjTVg8jXXaPQQct1XFECO1M3yXDmY+LzlqXJb1HhyRE9vAM8FSo6xfzzAP/MnwIQNRGC Gyp0oF2KyH7h3cUF3UujLjqUSYs= X-Google-Smtp-Source: AGHT+IGavgSTaVyzxEZhOdclXCCTYGh7jRCyafeiDujYjVchDEax/Efg5n2D7SrVzIcbri7DLAACyg== X-Received: by 2002:a17:903:1c7:b0:212:1f:e66b with SMTP id d9443c01a7336-2129f2a5333mr98790025ad.51.1732431415887; Sat, 23 Nov 2024 22:56:55 -0800 (PST) Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-2129dbf9791sm42035235ad.145.2024.11.23.22.56.55 for <54486-done@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Nov 2024 22:56:55 -0800 (PST) Message-ID: Date: Sat, 23 Nov 2024 22:56:54 -0800 MIME-Version: 1.0 Subject: Re: 29.0.50; Eshell `escaped' string property can "leak" into output Content-Language: en-US From: Jim Porter To: 54486-done@debbugs.gnu.org References: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> In-Reply-To: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 54486-done 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/20/2022 8:52 PM, Jim Porter wrote: > 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") In the intervening years, I've improved Eshell's parser to prevent other bugs, which has resulted in the 'escaped' string property no longer being useful. Instead, Eshell now propertizes text that has actual syntactic meaning: for example a globbing character like "*" gets the 'eshell-glob-char' text property. By marking *syntactic* characters with a text property, we ensure that Eshell only ever adds properties to text literally written into the Eshell buffer, which avoids the issue here. As a result of all this, we can now remove the calls that added that property in Eshell. I've now made this change in b4655ff99b5, so closing this bug. ------------=_1732431481-6362-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Mar 2022 03:52:51 +0000 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 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 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 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 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) 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 From: Jim Porter Subject: 29.0.50; Eshell `escaped' string property can "leak" into output To: bug-gnu-emacs@gnu.org Message-ID: <4246ce24-e48e-4bdf-4918-412bf6c0e595@gmail.com> Date: Sun, 20 Mar 2022 20:52:43 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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-Spam-Score: -1.3 (-) 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.3 (--) 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? ------------=_1732431481-6362-1--