Subject: bug#6226: Please add a customizable option to NOT call tramp for every sudo command

From: Thierry Volpiatto <[email-masked]>
Date: Wed, 26 May 2010 07:55:16 +0200

Michael Albinus <[email-masked]> writes:

> Stefan Monnier <[email-masked]> writes:
>
>>> fmakunbound does the job, yes. But i just think providing a defcustom
>>> interface
>>
>> Agreed.
>
> I don't know, whether another defcustom is needed. Eshell gives you
> already configuration hooks, for example:
>
> (add-hook 'eshell-named-command-hook
>           (lambda (command args)
>             (if (member command '("su" "sudo"))
>                 (throw 'eshell-replace-command
> 	               (eshell-parse-command (concat "*" command) args)))))
>
> Alternatively, one could disable the alias commands interactively in
> eshell, without further configuration:
>
> ~ $ fmakunbound (quote eshell/su)
> ~ $ fmakunbound (quote eshell/sudo)
>
> I will document both approches in eshell.texi.
OTOH adding an alias to su/sudo can solve problem:

alias sudo *sudo -p Password: $*
alias su LC_ALL=C *su -l

(if you enter the alias from eshell, you have to escape $)

-- 
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/