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

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



On 31 May, Bart Schaefer 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

> 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?

The command it runs comes from a specific editor zstyle, $VISUAL or
$EDITOR, all of which ought to only ever be set to a text editor. It's
always possible that someone shoots themself in the foot in this manner
and it was worth considering. I'd not worry overly unless such a setup
appears to be default for some OS/distribution.

The function already looks to see if it has vim or emacs. Perhaps it
could check for open/xdg-open. I couldn't find a mention of the editor
style in the documentation but if there, a warning could be attached
there.

Anyway, I have pushed the patch.

Oliver




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