GNU bug report logs -
#54486
29.0.50; Eshell `escaped' string property can "leak" into output
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Mon, 21 Mar 2022 03:53:02 UTC
Severity: normal
Found in version 29.0.50
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #22 received at 54486-done <at> debbugs.gnu.org (full text, mbox):
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.
This bug report was last modified 216 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.