Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Set TMPSUFFIX=.zsh in edit-command-line

On Sat, May 29, 2021 at 4:41 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Akinori MUSHA wrote on Fri, May 28, 2021 at 22:35:08 +0900:
> > This patch makes the name of a temporary file to have a .zsh suffix
> The patch looks good to me, but I haven't time to review or
> test it properly, so I'll defer to others on that.

Unless there's an internal bug with TMPSUFFIX, I can only think of one
way this patch could go wrong, and it's pretty obscure:

Suppose I have a "smart editor" that attempts to decide what program
to run based on file extension (opens .xls as a spreadsheet, .doc with
a word processor, etc.)  Suppose further that this "editor" opens
files ending in ".perl", ".zsh", ".sh", etc. by running the
corresponding interpreter.  Oops, I've just executed the command line
I meant to edit.

This is not entirely far-fetched, if you're on a Mac and have XCode
fully installed, "open /tmp/blablah.zsh" may actually run zsh.

Is this worth worrying about?

Messages sorted by: Reverse Date, Date, Thread, Author