Visudo should check env variables
oneElectron opened this issue · comments
ogsudo's visudo reads env variables in order to find the users preferred editor.
This should also be implemented in sudo-rs's visudo.
Additional context
ogsudo looks at the following environment variables in this order to find an editor:
- SUDO_EDITOR
- VISUAL
- EDITOR
If ogsudo's visudo cannot find the editor in one of those places it falls back to the editor set at build time (default is vi).
I would like to work on this issue myself.
Upon closer inpection visudo does include this functionality, however setting the EDITOR variable does not work (but VISUAL and SUDO_EDITOR do work).
That's interesting, there's no special handling for EDITOR
, it just happens to be the last one we check:
Lines 119 to 133 in 7a2de41