[systemd-devel] [PATCH] systemctl: add edit verb

Lennart Poettering lennart at poettering.net
Fri Oct 17 05:11:39 PDT 2014


On Fri, 17.10.14 14:29, Mantas Mikulėnas (grawity at gmail.com) wrote:

> > Technically proficient people will set $EDITOR or $VISUAL
> > anyway. Non-technical people won't. Non-technical people are likel to
> > be totally lost in vi/vim. For those folks probably nano makes a
> > better choice, simply because it shows an explanation of they
> > supported keys at the bottom of the screen.
> >
> > Hence, I think doing a logic like this would make sense:
> >
> > 1) if $EDITOR is set, use it
> > 2) otherwise: if $VISUAL is set, use it
> > 3) otherwise: if "nano" exists, use it
> > 4) otherwise: if "vim" exists, use it
> > 5) otherwise: if "vi" exists, use it
> 
> The list of editors seems fine.
> 
> Normally $VISUAL would be first, followed by $EDITOR...
> 
> (But in practice nobody sets them to different values anyway, since no
> programs aside from mailx care about the distinction. So it's fine
> either way, and just ignoring $VISUAL would be just as good.)

Is there a real distinction between $VISUAL and $EDITOR? environ(7)
makes no distinction, have any better docs that clarify the supposed
distinction?

To me it appears that $VISUAL is a bit more legacy thatn $EDITOR is...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list