1 |
On 1 Oct 2009, at 15:44, Arthur D. wrote: |
2 |
> ... |
3 |
> |
4 |
> I just installed VIM with emerge, and removed nano because I |
5 |
> considered |
6 |
> it to be absolutely unnecessary in my system. Why I need nano? I am |
7 |
> a VIM |
8 |
> fan. And here the troubles begin... |
9 |
> Run "sudo visudo" and you get this: |
10 |
> ~ $ sudo visudo |
11 |
> visudo: no editor found (editor path = /bin/nano) |
12 |
> ~ $ env | grep -i edit |
13 |
> EDITOR=/usr/bin/vim |
14 |
|
15 |
You seem to have alienated some responses with your posting manner, |
16 |
but it seems that folks are replying without reading the above. |
17 |
|
18 |
Here, as user stroller, `sudo visudo` runs nano. If I `su` to root, |
19 |
then vi is used. |
20 |
|
21 |
In both environments `echo $EDITOR` now returns "/usr/bin/vim". |
22 |
(previously user stroller had just "vi" set as editor, but changing it |
23 |
& sourcing .bashrc doesn't make any difference) |
24 |
|
25 |
I'm unclear why the user preference of editor seems to be ignored here. |
26 |
|
27 |
If I `touch /etc/sudoers.tmp && touch /etc/sudoers.tmp && chmod 777 / |
28 |
etc/sudoers.tmp /etc/sudoers` then `visudo` does indeed seem to use vi. |
29 |
|
30 |
So it seems to me that you're right. It appears like maybe when `sudo` |
31 |
detects that it's running `visudo` it does seem to ignore $EDITOR. I, |
32 |
too, disagree with this behaviour. IMO the ebuild ("--with-editor=/bin/ |
33 |
nano") take the editor from "/etc/rc.conf", but I'm extremely curious |
34 |
why upstream makes this behaviour, anyway. |
35 |
|
36 |
Stroller. |