X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=edc686595feef30c6010ed32e99b7425949dc230;hb=0fabaaf4ee69cfb2e3a310542d0204196cc2b2e3;hp=4ee87375f8f15d9e3f6ea620b23415e24fa9509a;hpb=3cf8371bd1ed9e7d95dff34653bfe0ac90ab75a1;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 4ee8737..edc6865 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -270,8 +270,32 @@ function grml_do_not_warn_skel() { printf 'GRML_WARN_SKEL=0\n' >>! ~/.zshrc.pre } -grml_warn_skel_main -grml_warn_skel_remove +# let's try to guess how the user uses us. +if is-at-least 4.3.7 ; then + # funcsourcetrace requires at least version 4.3.7 of zsh. + GRML_SRC_FILE="${${funcsourcetrace[1]}%:*}" + + grml_warn_skel_main + case ${GRML_SRC_FILE} in + (${HOME}/.zshrc.global) + grml_warn_skel_remove + printf '\nIt looks like you copied the grml zshrc to '\''~/.zshrc.global'\''.\n' + printf 'Nowadays you just copy the global zshrc to '\''~/.zshrc'\'' to use\n' + printf 'it on a non-grml-system.\n' + ;; + (${HOME}/.zshrc) + printf '\nIt looks like you copied the grml zshrc to '\''~/.zshrc'\''.\n' + printf 'We'\''ll disable this warning automatically for later sessions.\n' + grml_do_not_warn_skel + ;; + (*) + grml_do_not_warn_skel + ;; + esac +else + grml_warn_skel_main + grml_warn_skel_remove +fi unfunction grml_warn_skel_remove grml_warn_skel_main @@ -3538,7 +3562,7 @@ status() { print "" print "Date..: "$(date "+%Y-%m-%d %H:%M:%S")"" print "Shell.: Zsh $ZSH_VERSION (PID = $$, $SHLVL nests)" - print "Term..: $TTY ($TERM), $BAUD bauds, $COLUMNS x $LINES cars" + print "Term..: $TTY ($TERM), ${BAUD:+$BAUD bauds, }$COLUMNS x $LINES cars" print "Login.: $LOGNAME (UID = $EUID) on $HOST" print "System: $(cat /etc/[A-Za-z]*[_-][rv]e[lr]*)" print "Uptime:$(uptime)"