sudo-project/sudo

Cannot find/change keybindings for visudo on Rhino Linux

iconoclasthero opened this issue · 3 comments

visudo on my ubuntu 22.04 uses default nano keybindings.
on rhino linux it uses some alien keybindings I am unable to find... so instead of exiting ^X now deletes lines. Instead of page down, I have no idea wtf ^V does.

I really need to get to the bottom of this.

You would think, based on looking at man visudo that simply

sudo su
SUDO_EDITOR="nano --rcfile /etc/nanorc"
EDITOR="nano --rcfile /etc/nanorc"
VISUAL="nano --rcfile /etc/nanorc"
visudo
^D

would be sufficient to force the standard keybindings on visudo.

If you are running sudo visudo, you probably need to add:

Defaults env_keep += "SUDO_EDITOR EDITOR VISUAL"

to your sudoers file to preserve those environment variables. If you only want to preserve them for visudo itself you can do something like

Defaults!/usr/sbin/visudo env_keep += "SUDO_EDITOR EDITOR VISUAL"