Open pseyfert opened 8 years ago
I usually run a self built zsh instead of the standard login shell. So to avoid the problem in the first place I built zsh with --disable-etc
.
The environment in such a shell is about identical to that defined by lb-run
(up to SHLVL
and _
).
I mark the issue for now as won't fix despite the fact that the solution is terribly suboptimal.
NB: subshells started this way come without (LbLogin) aliases. i.e. your own ~/.zshrc
aliases are defined, but SetupDaVinci
is not. For lb-run
shells this hardy matters (won't do SetupX
in those) but if one just starts a self-compiled shell to have a better shell these aliases will be missed.
Discussing the matter on stackexchange I am tempted to:
ssh -t lxplus /afs/cern.ch/user/p/pseyfert/.local/bin/zsh-without-etc
because collecting all the desired bits from /etc
will be a mess (mostly if one would only collect LbLogin
. just starting from /etc/z*
based on SHLVL
might even work). and building two shells (one with and one without etc) is a comparable messalias myzsh="alias -L > ~/.tmpaliases; /..../zsh"
and alias mylbrun="alias -L > ~/.tmpaliases; lb-run"
(NB: checking if ~/.tmpaliases
and sourcing&deleting is in my ~/.zshrc
) (NB2: both without -g
) (NB3: this might mess up the lb-run
completion, immediately expanding it might be needed)the second hack actually brings us back close to the initial one-liner problem -- doing some sourcing based on quick diagnosis in ~/.zshrc
, just that all the /etc
is left and locked out.
Starting shells with
lb-run Project version shell
is not unproblematic. (the login scripts get sourced again after lb-run defined the correct environment, resulting in bad paths prepended to e.g. the python path). My current workaround isThis gets the user defined goodies without the system defined problems. Is there a oneliner solution?