Public bug reported:

Binary package hint: vim

When editing sudo's crontab using 'sudo crontab -e' ubuntu does not use
vim which is set as the default $EDITOR

What was tried:
----------------------
Method-1:
/home/<user>/.bashrc has export EDITOR=/usr/bin/vim

This works when I do crontab -e but not when sudo crontab -e

Method-2:
1. Removed EDITOR environment variable from /home/<user>/.bashrc
2. And tried
sudo update-alternatives --config editor

There are 5 alternatives which provide `editor'.

  Selection    Alternative
-----------------------------------------------
          1    /usr/bin/vim.tiny
          2    /bin/ed
          3    /bin/nano
          4    /usr/bin/vim.basic
*+        5    /usr/bin/vim.gnome

Again, this works when I do crontab -e but not when sudo crontab -e. I
tried 1, 4 and 5. No dice.

Method-3:
sudo EDITOR=vim crontab -e works. But why should I prefix the command with the 
environment variable everytime I run it. It should pick the editor as set in 
Method-1 and Method-2.

What is expected to happen: 'sudo crontab -e' should open the crontab
using the default system $EDITOR without much fuss.


More info: http://ubuntuforums.org/showthread.php?t=1075667

** Affects: vim (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  Binary package hint: vim
  
  When editing sudo's crontab using 'sudo crontab -e' ubuntu does not use
  vim which is set as the default $EDITOR
  
  What was tried:
  ----------------------
  Method-1:
  /home/<user>/.bashrc has export EDITOR=/usr/bin/vim
  
  This works when I do crontab -e but not when sudo crontab -e
  
  Method-2:
  1. Removed EDITOR environment variable from /home/<user>/.bashrc
  2. And tried
  sudo update-alternatives --config editor
  
  There are 5 alternatives which provide `editor'.
  
    Selection    Alternative
  -----------------------------------------------
            1    /usr/bin/vim.tiny
            2    /bin/ed
            3    /bin/nano
            4    /usr/bin/vim.basic
  *+        5    /usr/bin/vim.gnome
  
  Again, this works when I do crontab -e but not when sudo crontab -e. I
  tried 1, 4 and 5. No dice.
  
  Method-3:
  sudo EDITOR=vim crontab -e works. But why should I prefix the command with 
the environment variable everytime I run it. It should pick the editor as set 
in Method-1 and Method-2.
  
  What is expected to happen: 'sudo crontab -e' should open the crontab
  using the default system $EDITOR without much fuss.
+ 
+ 
+ More info: http://ubuntuforums.org/showthread.php?t=1075667

-- 
 sudo crontab -e uses wrong vi version
https://bugs.launchpad.net/bugs/372588
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to