dump screen in favor of tmux
This commit is contained in:
parent
5170fda321
commit
33b6bc653d
5 changed files with 123 additions and 28 deletions
|
@ -9,25 +9,30 @@ if [[ -a "$OVER_PROMPT_CFG" ]]; then
|
|||
source "$OVER_PROMPT_CFG"
|
||||
fi
|
||||
|
||||
function __over_prompt_set_title {
|
||||
if [[ -n "${OVER_PROMPT_TITLE}" ]]; then
|
||||
print -Pn "\033k${OVER_PROMPT_TITLE}\033\134"
|
||||
else
|
||||
print -Pn "\033k${@}\033\134"
|
||||
fi
|
||||
}
|
||||
# both tmux and screen set TERM=screen
|
||||
if [[ "${TERM}" == "screen" ]]; then
|
||||
function __over_prompt_set_title {
|
||||
if [[ -n "${OVER_PROMPT_TITLE}" ]]; then
|
||||
print -Pn "\033k${OVER_PROMPT_TITLE}\033\134"
|
||||
else
|
||||
print -Pn "\033k${@}\033\134"
|
||||
fi
|
||||
}
|
||||
else
|
||||
function __over_prompt_set_title { }
|
||||
fi
|
||||
|
||||
function set_title {
|
||||
OVER_PROMPT_TITLE="$1"
|
||||
}
|
||||
|
||||
function __over_prompt_preexec {
|
||||
__over_prompt_set_title "${1:0:8}"
|
||||
__over_prompt_set_title "${1}"
|
||||
OVER_PROMPT_CMD_START=${EPOCHSECONDS}
|
||||
}
|
||||
|
||||
function __over_prompt_precmd {
|
||||
__over_prompt_set_title "${USER}"
|
||||
__over_prompt_set_title "${PWD//*\//} (${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}" "${OVER_PROMPT_CMD_START}"
|
||||
PS1="$(print "%(?.%{\e[1;36m%}.%{\e[1;31m%}%?%{\e[0m%}:%{\e[1;31m%})%(\!.#.$)%{\e[0m%} ")"
|
||||
OVER_PROMPT_LAST_REFRESH=${EPOCHSECONDS}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue