From: Stephane Chazelas <Stephane_Chazelas@yahoo.fr>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: environment settings
Date: Mon, 23 Jun 2008 17:29:13 +0100 [thread overview]
Message-ID: <20080623162913.GN4961@sc.homeunix.net> (raw)
In-Reply-To: <080623092011.ZM30795@torch.brasslantern.com>
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
prev parent reply other threads:[~2008-06-23 16:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080616074651.GB26165@marcus>
[not found] ` <20080616080556.GA5091@sc.homeunix.net>
[not found] ` <20080616123045.GC26165@marcus>
[not found] ` <20080616124450.GC5091@sc.homeunix.net>
2008-06-17 8:33 ` Jörg Sommer
2008-06-17 9:39 ` Stephane Chazelas
2008-06-17 10:41 ` Vincent Lefevre
2008-06-17 12:58 ` Stephane Chazelas
2008-06-17 13:11 ` Vincent Lefevre
2008-06-17 13:26 ` Stephane Chazelas
2008-06-17 13:28 ` Mikael Magnusson
2008-06-17 14:25 ` Stephane Chazelas
2008-06-17 15:54 ` Vincent Lefevre
2008-06-17 16:00 ` Stephane Chazelas
2008-06-17 19:50 ` Vincent Lefevre
2008-06-17 20:32 ` Stephane Chazelas
2008-06-18 10:38 ` Vincent Lefevre
2008-06-18 11:52 ` Stephane Chazelas
2008-06-18 17:11 ` Bart Schaefer
2008-06-17 14:55 ` Vincent Lefevre
2008-06-17 14:45 ` Vincent Lefevre
2008-06-18 8:49 ` Jörg Sommer
2008-06-18 9:33 ` Stephane Chazelas
2008-06-21 6:26 ` Wayne Davison
2008-06-21 11:36 ` Vincent Lefevre
2008-06-21 12:30 ` Stephane Chazelas
2008-06-22 8:41 ` Vincent Lefevre
2008-06-23 15:24 ` Stephane Chazelas
2008-06-23 16:16 ` Vincent Lefevre
2008-06-23 16:20 ` Bart Schaefer
2008-06-23 16:29 ` Stephane Chazelas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080623162913.GN4961@sc.homeunix.net \
--to=stephane_chazelas@yahoo.fr \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).