Re: Replacing nano-default-editor doesn't affect visudo
Jonathan Wakely via devel <[email protected]>
| Newsgroups | gmane.linux.redhat.fedora.devel |
|---|---|
| Message-ID | <CACb0b4kP7iH=CMLeM6+Tkyw4ALKGs8RwQs2WkHgQORfDyrV-uA@mail.gmail.com> |
On Fri, 28 Aug 2026 at 18:05, Jonathan Wakely <[email protected]> wrote: > > I recently installed a new Fedora system and was recreating all my > preferred settings and realized that: > > 1) The https://fedoraproject.org/wiki/Changes/UseNanoByDefault change > for F33 never did the suggested documentation change, i.e. the Fedora > quick docs do not say how to replace nano by installing > vim-default-editor. That would be helpful. > > 2) Installing vim-default-editor doesn't help with 'sudo visudo' as > that command will still use nano to edit the sudoers file. That's > because the sudo command isn't in a login shell and so will not have > EDITOR set in the environment. This means that visudo doesn't care > about the environment, it only cares about the sudoers 'editor' > setting. This seems to have changed for F36 via https://bugzilla.redhat.com/show_bug.cgi?id=1328973#c14 mattdm made visudo default to nano, on the basis that it's the default since F33. But because 'sudo visudo' doesn't respect EDITOR by default, this means that nano is the default for visudo even for people who have installed vim-default-editor, or set EDITOR manually. Let's be honest, the users that the F33 UseNanoByDefault change benefits (those who don't know how to set EDITOR in their shell settings) probably aren't going to be running visudo anyway. And the people who do know how to set it find that visudo ignores their EDITOR setting. This isn't a great experience. > > To get visudo to use vim, you need to either completely uninstall > nano, or use 'sudo --login visudo', or add this to the sudoers config: > > Defaults editor /usr/bin/vim > > Is there a better way to "fix" visudo to use vim, without having to > manually edit config files or use sudo --login every time? If not, > should we add one? Should the nano-default-editor and > vim-default-editor packages install an extra file under /etc/sudoers.d > to set the editor? > > I fully support using nano as the system-wide default, but it should > be easy to switch back to vim for the people who want that. -- _______________________________________________ devel mailing list -- [email protected] To unsubscribe send an email to [email protected] Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/[email protected] Do not reply to spam, report it: https://forge.fedoraproject.org/infra/tickets/issues/new