Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: environment settings



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.



Messages sorted by: Reverse Date, Date, Thread, Author