Changes to zsh history behavior and misc commands.

Local (in-memory) history works as before, but only successful commands
are commited to storage.

Prompt's preexec and precmd hooks no longer corrupt the namespace.

Zsh function http-dir now uses vanilla python3 instead of thttpd.

Removed aliases/functions: cds, tomp4, swap-files.
This commit is contained in:
Martin Sekera 2019-09-27 18:28:38 +02:00
parent eb9fece0a8
commit dd6ea5923c
2 changed files with 45 additions and 28 deletions

View file

@ -6,21 +6,21 @@ if [[ -a "$OVER_PROMPT_CFG" ]]; then
source "$OVER_PROMPT_CFG"
fi
function set_title {
function __over_prompt_set_title {
if [[ ${TERM} =~ "screen" ]]; then
print -Pn "\033k\033${@}\033\134"
fi
}
function preexec {
function __over_prompt_preexec {
local -a cmd
cmd=(${(z)1})
set_title "${USER}: ${PWD} -> ${cmd}"
__over_prompt_set_title "${USER}: ${PWD} -> ${cmd}"
}
function precmd {
set_title "${USER}: ${PWD}"
function __over_prompt_precmd {
__over_prompt_set_title "${USER}: ${PWD}"
python3 /usr/share/over-env/prompt.py "${COLUMNS}" "${PWD}" "${OVER_PROMPT_LAST_REFRESH}" "${OVER_PROMPT_SYSLOAD_WARN:=1.25}" "${OVER_PROMPT_SYSLOAD_YELL:=3.0}" "${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)