On Fri, Jun 26, 2020 at 8:35 AM Chris Adams <linux(a)cmadams.net> wrote:
Once upon a time, Zdenek Dohnal <zdohnal(a)redhat.com> said:
> I'm not sure if which other applications use the default editor, I know
> only git from those. So let's say I will talk about the editor which
> git-commit spawns during committing a change.
There are a variety of CLI tools that use $EDITOR (do any still use
$VISUAL? I still set that out of habit), and usually default to /bin/vi
in the absence of a setting. On one desktop system, I see about 20
packages that appear like they might be referencing $EDITOR (just
grepping in /usr/bin and /usr/sbin).
I've been using vi/vim for almost 30 years, and have set $EDITOR and
$VISUAL for the whole time. I honestly didn't realize $EDITOR wasn't
being defaulted to /bin/vi, and we just have programs with their own
arbitrary default. So I'm definitely +1 to explicitly setting it.
I would go with /etc/profile.d snippets, because that's the most obvious
and historical place (for Red Hat-derived systems at least).
Alternately, the default PAM config loads pam_env, which will look in
/etc/security/pam_env.conf, /etc/environment, and ~/.pam_environment by
default. There's possibly other things that could be moved here; if
this isn't a good use for it, I don't know what is (why are we loading
pam_env if we aren't going to use it?).
Actually, if we turn on PAM's support for split distro/admin
configuration, we *could* ship this as a pam.d snippet in /usr and
allow the admin to override it in /etc if they wish. This might work
better than profile.d snippets too, since it'd be one file for all the
shells, rather than a bunch of files for every shell.
--
真実はいつも一つ!/ Always, there's only one truth!