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

Re: $PPID not updated when the PPID changes (parent killed)



On 5/18/21, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> Aside, it's a bit odd that SHLVL isn't read-only.  Even assorted Bash
> tutorials found by online search treat it as immutable (statements
> like "$dog is only available at SHLVL 2") despite that it can be
> arbitrarily messed with.

I sometimes set it (in practice only to the empty string), such that
the first shell in a new terminal always ends up with SHLVL=1 (my
prompt hilights when it is non-1 so that i know i can safely exit
without having the terminal be closed, eg while testing new zsh builds
or other things where i want a temporary shell state). I also do some
window manager development so things like "SHLVL= openbox --replace"
tend to happen as well.

-- 
Mikael Magnusson




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