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

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



On 2021/06/01 7:54, Bart Schaefer wrote:
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:
Thanks for the consideration.
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?

At least it does not reproduce on my Mac, where Xcode is opened for editing the script.  On Ubuntu Desktop, .zsh is associated with gedit by default.  If one dares to change that to make double-clicking in general unsafe and then set EDITOR to open/start as well, I say they are shooting their own foot.

--
Akinori MUSHA / https://akinori.org/

Attachment: OpenPGP_signature
Description: OpenPGP digital signature



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