Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: environment settings
- X-seq: zsh-workers 25241
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: environment settings
- Date: Mon, 23 Jun 2008 17:29:13 +0100
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <080623092011.ZM30795@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080616080556.GA5091@xxxxxxxxxxxxxxx> <20080616123045.GC26165@marcus> <20080616124450.GC5091@xxxxxxxxxxxxxxx> <slrng5etlu.mft.joerg@xxxxxxxxxxxx> <20080621062649.GA28022@xxxxxxxxx> <20080621113659.GA20796@xxxxxxxxxxxxxxxxxxx> <20080621123049.GA7027@xxxxxxxxxxxxxxx> <20080622084152.GQ10734@xxxxxxxxxxxxxxxxxxx> <20080623152431.GM4961@xxxxxxxxxxxxxxx> <080623092011.ZM30795@xxxxxxxxxxxxxxxxxxxxxx>
On Mon, Jun 23, 2008 at 09:20:11AM -0700, Bart Schaefer wrote:
> On Jun 23, 4:24pm, Stephane Chazelas wrote:
> }
> } It's true it would be nice to be able to distinguish between zsh
> } instances that are meant to be user shells that is that are
> } meant to parse command lines given by the user and instances
> } that are meant to run canonical zsh code where the user is not
> } meant to alter the zsh behavior (as in zsh scripts, zsh -c ...)
> }
> } With zsh, you could solve that by having $SHELL be /path/to/user-zsh
>
> Unfortunately I think you at least have to turn this inside-out, because
> /etc/passwd usually is restricted to values that are in /etc/shells.
>
> So something like this in .zshenv:
>
> if [[ $0 != (*/|)user-zsh && -o interactive ]]; then
> export SHELL=~/bin/user-zsh
> # ... etc. ...
> fi
>
> But that's not going to address Vincent's complaint that shells started
> for globbing by e.g. GDB should pick up settings like extended_glob.
> Even SHLVL isn't always accurate; what you'd really need to do is look
> up the parent process and decide based on that.
Then you can set $SHELL to user-zsh in .zprofile and use the
same trick as I was suggesting (that is source .zshrc in .zshenv
if $0 is user-zsh). Won't work for ssh though.
That's the kind of trick you use when you want to use zsh on
systems where zsh is not installed system-wide or where you're
not allowed to change your login shell (
# ~/.profile simplified
SHELL=~/bin/user-zsh
export SHELL
exec "$SHELL"
)
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author