zshrc: always set terminal title

This commit is contained in:
Martinez 2016-04-26 17:25:28 +02:00
parent 41c59c698d
commit 263a7451af

View file

@ -7,20 +7,18 @@ if [[ -a "$OVER_PROMPT_CFG" ]]; then
fi
function set_title {
if [[ ${TERM} == "screen-bce" || ${TERM} == "screen" ]]; then
print -Pn "\033k\033${@}\033\134"
fi
}
function preexec {
local -a cmd
cmd=(${(z)1})
set_title "${PWD}: ${cmd}"
set_title "${USER}:${PWD} -> ${cmd}"
}
function precmd {
set_title "${PWD}"
set_title "${USER}:${PWD}"
python3 /usr/libexec/over-prompt.py "${COLUMNS}" "${PWD}" "${OVER_PROMPT_LAST_REFRESH}" "${OVER_PROMPT_SYSLOAD_WARN:=1.25}" "${OVER_PROMPT_SYSLOAD_YELL:=2.5}" "${OVER_PROMPT_FREESPACE_WARN:=0.15}" "${OVER_PROMPT_FREESPACE_YELL:=0.05}"
PS1="$(print "%(?.%{\e[1;36m%}.%{\e[1;31m%}%?%{\e[0m%}:%{\e[1;31m%})%(\!.#.$)%{\e[0m%} ")"
OVER_PROMPT_LAST_REFRESH=$(date +%s)