Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to complete alias after alias of sudo?
- X-seq: zsh-users 22724
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: How to complete alias after alias of sudo?
- Date: Fri, 02 Jun 2017 09:46:56 +0100
- Cms-type: 201P
- In-reply-to: <20170602035746.GA6211@localhost.localdomain>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CGME20170531082709epcas5p4cb74739bb440049fd96ca18a08489bbd@epcas5p4.samsung.com> <20170531064655.GA8512@localhost.localdomain> <20170531094310.59bb7110@pwslap01u.europe.root.pri> <20170601054320.GA3602@localhost.localdomain> <20170601101945.02560589@pwslap01u.europe.root.pri> <20170602035746.GA6211@localhost.localdomain>
On Fri, 2 Jun 2017 11:57:46 +0800
Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> Thanks. But looks like the situation is a bit different. I have aliased
> 'sd' to 'sudo -i ', so another alias after 'sd' will be expanded before
> command running. So the alias won't be passed to another shell. But
> looks like it's not easy to enable alias completion in this situation?
Possibly my patch --- which I think ought to do what you want in this
as a side effect --- is the best we've got? To be clear:
Your case: you have a special alias for "sudo -i" so that the next word
is expanded at an alias in the current shell --- before sudo is called.
Standard case: "sudo -i" runs the command in a shell, so it will use
whatever shell environment has been provided in the sudo environment.
In general we don't know what that is, and quite like using the local
environment for completing functions and aliases isn't right. But
without much more digging this may be the best solution.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author