3 # Process the exceptions which allow logging out while still having
6 # This is weird . . $1 seems to contain "logout" because the "logout"
7 # command has been aliased to "noglob logout" - and $0 is the noglob.
8 # I can't believe that this is what is meant to happen.
13 # If the checkjobs option is unset, just plain exit. (This option
14 # emerged in zsh 3.1.8.)
15 if [[ ! -o checkjobs ]]
19 # Did I type logout twice in a row? Note check for history number.
20 if [[ $history[$#history] = (exit|(logout|lo)(|\ *)) || $lastlogout = $#history ]]; then
24 # Did I type jobs, then logout?
25 if [[ $history[$#history] = (j(|obs)(|\ *)) ]]; then
31 # Emulate the code that protects against logout if I have
33 if [[ $#jobstates -gt 0 ]]; then
34 # The first listed state is good enough to be a hint of my job states.
35 echo "You have ${jobstates[${${(k)jobstates}[1]}]%%:*} jobs."
39 # If we got here we're really exiting.