Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ${EDITOR} with spaces (was: Re: [PATCH] initialization of main keymap)
- X-seq: zsh-workers 50605
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: ${EDITOR} with spaces (was: Re: [PATCH] initialization of main keymap)
- Date: Mon, 5 Sep 2022 11:15:32 +0200
- Archived-at: <https://zsh.org/workers/50605>
- In-reply-to: <CAHYJk3S4k-t_mhrvZ59yThgD=ey890aNotpeVU7Yjw-0gdAaqg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- References: <CAH+w=7bd+XYR6nOFj0iY-0b50Wpz_9c1yGV98acutpzamWSkkw@mail.gmail.com> <20220901002300.GD992100@zira.vinc17.org> <CAH+w=7axKWJG5cVbx+QDo2fEo2k00L3y4sN3-UhDofVkmY8n2w@mail.gmail.com> <20220901012122.GA1046913@zira.vinc17.org> <CAH+w=7adkUOsBiDTksC9YV=eat5f1CX05RJr5GoU=ae_79HngQ@mail.gmail.com> <20220902000406.GB1046913@zira.vinc17.org> <CAH+w=7amNukqmEBHirDMPx5W_+H9Hc2UVbQsDoNyQFY+j1Zrgg@mail.gmail.com> <20220902131533.GC255755@cventin.lip.ens-lyon.fr> <20220904094216.GV5920@tarpaulin.shahaf.local2> <CAHYJk3S4k-t_mhrvZ59yThgD=ey890aNotpeVU7Yjw-0gdAaqg@mail.gmail.com>
On 2022-09-04 12:48:20 +0200, Mikael Magnusson wrote:
> On 9/4/22, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > Vincent Lefevre wrote on Fri, Sep 02, 2022 at 15:15:33 +0200:
> >> Yes, the current behavior (with or without the patch) is definitely
> >> incorrect. For instance, https://unix.stackexchange.com/a/4861/74516
> >> suggests to set VISUAL to the full-screen editor, and either leave
> >> EDITOR unset or set it to "vi -e" (just in case a special line mode
> >> would be needed in some context). So a user who would use VISUAL=emacs
> >> and EDITOR="vi -e" would probably be annoyed by the current behavior.
> >
> > Is $EDITOR meant to be used in a system(3) manner, as «system("${EDITOR}
> > ${(q-)filename}")»,
> > or in an execve(2) manner, as «execl($EDITOR, $EDITOR, $filename)»?
> > (plus or minus a «--» guard in both cases)
>
> In practice, if you want $EDITOR to contain options to your editor,
> you have to make a wrapper script and put it in a path without spaces,
> because programs all assume different answers to your question.
Indeed, for EDITOR, under "mailx", POSIX says "name of a utility"
and not "command". This is a bit unclear about the possibility of
full pathnames, but under "more", POSIX says "If the last pathname
component in EDITOR is either vi or ex, [...]" so it is now clear
that EDITOR may contain a full pathname (there wasn't any practical
reason for a restriction).
For VISUAL, POSIX says "pathname of a utility".
So, in both cases, options should not be accepted, i.e. spaces
should be regarded as part of the name (though I wonder whether
this is portable in practice).
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author