Subject: bug#30724: eshell: escaped tilde is not treated as such

From: Noam Postavsky <[email-masked]>
Date: Thu, 08 Mar 2018 20:15:16 -0500

tags 30724 + confirmed
quit

Yegor Timoshenko <[email-masked]> writes:

> In M-x eshell (do not run):
>
>   $ touch \~
>   $ ls
>   ~
>   $ rm \~
>   rm: cannot remove '~': Is a directory
>
> I.e. it tried to remove home directory. I've found this by
> accidentially wiping my home directory, but no worry, I've restored a
> btrfs snapshot that was made several minutes before that.
>
> GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
>  of 2018-02-25

Stepping through eshell/rm a bit, I see it gets #("~" 0 1 (escaped t))
as an argument.  So each command is responsible for handling the
escaping correctly.  I think every file-handling eshell function needs
review for this.