mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 18:38:00 +00:00
Better TTY logic for zlogin and zlogout
This commit is contained in:
parent
029414581e
commit
e2785cc246
@ -14,10 +14,13 @@
|
|||||||
fi
|
fi
|
||||||
} &!
|
} &!
|
||||||
|
|
||||||
|
# Execute code only if STDERR is bound to a TTY.
|
||||||
|
[[ -o INTERACTIVE && -t 2 ]] && {
|
||||||
|
|
||||||
# Print a random, hopefully interesting, adage.
|
# Print a random, hopefully interesting, adage.
|
||||||
if (( $+commands[fortune] )); then
|
if (( $+commands[fortune] )); then
|
||||||
if [[ -t 0 || -t 1 ]]; then
|
|
||||||
fortune -s
|
fortune -s
|
||||||
print
|
print
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
} >&2
|
||||||
|
@ -5,9 +5,14 @@
|
|||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Execute code only if STDERR is bound to a TTY.
|
||||||
|
[[ -o INTERACTIVE && -t 2 ]] && {
|
||||||
|
|
||||||
# Print the message.
|
# Print the message.
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
|
|
||||||
Thank you. Come again!
|
Thank you. Come again!
|
||||||
-- Dr. Apu Nahasapeemapetilon
|
-- Dr. Apu Nahasapeemapetilon
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
} >&2
|
||||||
|
Loading…
Reference in New Issue
Block a user